/* ===== 打赏管理后台 样式 ===== */
:root {
  --bg: #f4f6fa;
  --panel: #ffffff;
  --ink: #1f2733;
  --ink-2: #5b6675;
  --ink-3: #97a1b0;
  --line: #e6eaf1;
  --brand: #2f6fed;
  --brand-d: #2459c4;
  --ok: #12a15c;
  --warn: #e08a00;
  --danger: #e04b4b;
  --sidebar: #1d2532;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(24, 39, 75, .06), 0 6px 20px rgba(24, 39, 75, .05);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #eef2f8; padding: 1px 6px; border-radius: 5px; font-size: 12.5px; color: #31415c; }
h1, h2, h3 { margin: 0; font-weight: 600; }

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

.sidebar {
  width: 232px;
  flex: 0 0 232px;
  background: var(--sidebar);
  color: #c8d2e0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 20px 18px 16px; }
.brand-logo {
  width: 36px; height: 36px; flex: 0 0 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #4a86ff, #2f6fed);
  color: #fff; font-weight: 700; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}
.brand-logo.lg { width: 52px; height: 52px; flex-basis: 52px; font-size: 22px; border-radius: 14px; margin: 0 auto 12px; }
.brand-title { color: #fff; font-weight: 600; font-size: 15px; line-height: 1.3; }
.brand-sub { font-size: 11.5px; color: #7f8b9e; }

.nav { padding: 8px 10px; flex: 1; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin-bottom: 2px;
  border-radius: 9px; color: #b6c1d1; font-size: 14px;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav-item.active { background: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(47,111,237,.35); }
.nav-item svg { opacity: .9; }

.sidebar-foot { padding: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.who { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.who .dot { width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; flex: 0 0 8px; box-shadow: 0 0 0 3px rgba(61,220,132,.16); }
.who-name { color: #e8eef7; font-size: 13px; }
.who-time { color: #78859a; font-size: 11px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 26px 0; 
}
.page-title { font-size: 21px; }
.topbar-actions { display: flex; gap: 8px; }
.content { padding: 16px 26px 30px; flex: 1; }
.foot { padding: 16px 26px 24px; color: var(--ink-3); font-size: 12px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--panel);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 16px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
.card-head h2 { font-size: 15px; }
.card-head.mt { margin-top: 20px; }
.head-actions { display: flex; align-items: center; gap: 12px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 16px; }
.cards-sm .stat-value { font-size: 22px; }
.stat { padding: 16px 18px; }
.stat-label { color: var(--ink-2); font-size: 12.5px; margin-bottom: 6px; }
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -.5px; }
.stat-sub { color: var(--ink-3); font-size: 12px; margin-top: 4px; }
.stat-warn .stat-value { color: var(--warn); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 1000px) { .grid-2 { grid-template-columns: 1fr; } }

.card-narrow { max-width: 620px; }

/* ---------- 图表 ---------- */
.chart { display: flex; align-items: flex-end; gap: 8px; height: 170px; padding-top: 18px; }
.chart-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; text-align: center; }
.chart-bar {
  background: linear-gradient(180deg, #5b93ff, #2f6fed);
  border-radius: 6px 6px 3px 3px;
  min-height: 3px; position: relative; transition: filter .15s;
}
.chart-col:hover .chart-bar { filter: brightness(1.08); }
.chart-val { position: absolute; top: -17px; left: 0; right: 0; font-size: 10.5px; color: var(--ink-2); }
.chart-x { font-size: 11px; color: var(--ink-3); margin-top: 6px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; font-weight: 600; color: var(--ink-2);
  font-size: 12px; text-transform: none; letter-spacing: .2px;
  padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 10px; border-bottom: 1px solid #f0f3f8; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table-hover tbody tr:hover { background: #f8fafd; }
.ta-r { text-align: right; }
.nowrap { white-space: nowrap; }
.amt { font-weight: 600; color: var(--ok); }
.ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.actions { display: flex; gap: 4px; justify-content: flex-end; align-items: center; }
.actions form.inline { display: inline; }

/* ---------- 徽章 / 标签 ---------- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; }
.badge-ok { background: #e4f7ee; color: #0d8a4e; }
.badge-warn { background: #fff4e0; color: #b06d00; }
.badge-muted { background: #eef1f6; color: #77839a; }
.badge-error { background: #fdeaea; color: #c33; }

/* 支付通道配色 */
.badge-alipay { background: #e8f0fe; color: #2f6fed; }
.badge-wxpay  { background: #e6f7ee; color: #12a15c; }
.badge-qqpay  { background: #e6f5fd; color: #12b7f5; }
.badge-bank   { background: #fdeaea; color: #d7263d; }
.badge-jdpay  { background: #fdeceb; color: #e4393c; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 6px; background: #eef2f8; color: #45536b; font-size: 12px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 15px; border-radius: 9px; border: 1px solid transparent;
  font-size: 13.5px; font-weight: 500; cursor: pointer; line-height: 1.4;
  background: #eef2f8; color: var(--ink); text-decoration: none;
  transition: background .15s, box-shadow .15s, transform .05s;
  font-family: inherit;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-d); color: #fff; }
.btn-ok { background: var(--ok); color: #fff; }
.btn-ok:hover { background: #0e8b4f; color: #fff; }
.btn-danger { background: #fdeaea; color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { background: #f5f8fd; color: var(--ink); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-xs { padding: 4px 9px; font-size: 12px; border-radius: 7px; }
.btn-block { width: 100%; }

/* ---------- 表单 ---------- */
.form-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px 16px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.field > span em { font-style: normal; color: var(--ink-3); font-weight: 400; font-size: 11.5px; margin-left: 5px; }
.field-wide { grid-column: 1 / -1; }
.field-inline { flex-direction: row; align-items: center; gap: 7px; }

input[type="text"], input[type="password"], input[type="number"], input[type="date"],
input[type="search"], select, textarea {
  width: 100%; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: 9px;
  font-size: 13.5px; color: var(--ink); background: #fff;
  font-family: inherit; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(47,111,237,.12);
}
textarea { resize: vertical; }
input[type="file"] { font-size: 12.5px; padding: 6px 0; border: 0; }

.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.check-sm { font-size: 12.5px; }

/* 开关列表 */
.switch-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 2px 20px; }
.switch-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 0; cursor: pointer;
  border-bottom: 1px dashed #f0f3f8;
}
.switch-row input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--brand); flex: 0 0 17px; }
.switch-text { display: flex; flex-direction: column; gap: 2px; }
.switch-text strong { font-size: 13.5px; font-weight: 500; color: var(--ink); }
.switch-text em { font-style: normal; font-size: 12px; color: var(--ink-3); }
.mt-sep { margin-top: 12px; padding-top: 14px; border-top: 1px solid var(--line); }

/* 键值展示 */
.kv { display: flex; flex-direction: column; gap: 2px; }
.kv-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 8px 0; border-bottom: 1px dashed #f0f3f8; font-size: 13px;
}
.kv-row:last-child { border-bottom: 0; }
.kv-k { flex: 0 0 190px; color: var(--ink-2); font-size: 12.5px; }
.kv-row code { word-break: break-all; }

/* 明文密码单元格 */
.pw-cell {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  background: #fff6e5;
  border: 1px solid #ffe2b0;
  color: #8a5a00 !important;
  cursor: pointer;
}
.pw-cell:hover { background: #ffefd1; }
.sticky-actions {
  position: sticky; bottom: 0; z-index: 5;
  background: rgba(244, 246, 250, .92); backdrop-filter: blur(6px);
  margin: 0 0 16px; padding: 12px 0;
}

.form-actions { grid-column: 1 / -1; display: flex; gap: 10px; padding-top: 4px; }

.filter-bar {
  display: flex; flex-wrap: wrap; gap: 9px; align-items: center;
}
.filter-bar input[type="text"] { flex: 1 1 220px; min-width: 160px; }
.filter-bar select { flex: 0 0 auto; width: auto; min-width: 118px; }
.filter-bar input[type="date"] { width: auto; }
.tilde { color: var(--ink-3); }
.inline-forms { display: flex; flex-wrap: wrap; gap: 22px; align-items: center; }

/* ---------- 上传 / 预览 ---------- */
.upload-row { display: flex; gap: 16px; align-items: flex-start; }
.qr-preview {
  width: 108px; height: 108px; flex: 0 0 108px;
  border: 1px dashed var(--line); border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: #fafbfe; overflow: hidden;
}
.qr-preview img { width: 100%; height: 100%; object-fit: contain; }
.qr-none { color: var(--ink-3); font-size: 12px; }
.upload-ctl { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.thumb { width: 46px; height: 46px; object-fit: contain; border: 1px solid var(--line); border-radius: 7px; background: #fff; vertical-align: middle; margin-right: 8px; }
.tiny { font-size: 11px; }

/* ---------- 提示 ---------- */
.alert { padding: 11px 15px; border-radius: 10px; margin-bottom: 14px; font-size: 13.5px; }
.alert-success { background: #e4f7ee; color: #0d7a46; border: 1px solid #c3eeda; }
.alert-error { background: #fdeaea; color: #b83030; border: 1px solid #f7d2d2; }
.alert-info { background: #e8f0fe; color: #23539e; border: 1px solid #d3e2fb; }
.alert-warn { background: #fff6e5; color: #8a5a00; border: 1px solid #ffe2b0; }

.empty { color: var(--ink-3); text-align: center; padding: 26px 10px; margin: 0; }
.muted { color: var(--ink-3); font-size: 12.5px; }
.link { color: var(--brand); font-size: 13px; }
.hint { color: var(--ink-2); font-size: 13px; margin: 10px 0 0; }
.hint-list { color: var(--ink-2); font-size: 13px; margin: 8px 0 0; padding-left: 20px; }
.hint-list li { margin-bottom: 4px; }

/* ---------- 列表 / 分页 ---------- */
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px dashed #eef1f6; font-size: 13px;
}
.mini-list li:last-child { border-bottom: 0; }
.mini-name { flex: 1; }
.mini-amt { color: var(--ok); font-weight: 600; }
.mini-time { color: var(--ink-3); font-size: 12px; }

.pager { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 16px; justify-content: flex-end; }
.pg {
  min-width: 32px; padding: 5px 9px; text-align: center;
  border: 1px solid var(--line); border-radius: 8px;
  font-size: 12.5px; color: var(--ink-2); background: #fff;
}
.pg:hover { text-decoration: none; border-color: var(--brand); color: var(--brand); }
.pg.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.pg.disabled { opacity: .45; pointer-events: none; }

/* ---------- 登录页 ---------- */
.login-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(140deg, #1d2532 0%, #33405a 100%);
  padding: 24px;
}
.login-card {
  width: 100%; max-width: 380px; background: #fff;
  border-radius: 16px; padding: 30px 28px 24px;
  box-shadow: 0 20px 60px rgba(10, 20, 40, .35);
}
.login-head { text-align: center; margin-bottom: 22px; }
.login-head h1 { font-size: 19px; margin-bottom: 4px; }
.login-head p { margin: 0; color: var(--ink-3); font-size: 12.5px; }
.login-card .field { margin-bottom: 14px; }
.login-foot { text-align: center; margin-top: 16px; color: var(--ink-3); font-size: 11.5px; }
.install-card { max-width: 520px; }
.install-log { list-style: none; padding: 0; margin: 0 0 16px; font-size: 13px; color: var(--ink-2); }
.install-log li { padding: 6px 0; border-bottom: 1px dashed #eef1f6; }

/* ---------- 响应式 ---------- */
@media (max-width: 820px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; flex: none; height: auto; position: static; flex-direction: row; align-items: center; flex-wrap: wrap; }
  .nav { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 10px; width: 100%; }
  .nav-item { padding: 7px 11px; font-size: 13px; }
  .brand { padding: 14px 16px 0; }
  .sidebar-foot { display: flex; align-items: center; gap: 12px; width: 100%; border-top: 0; padding: 8px 16px 14px; }
  .who { margin-bottom: 0; flex: 1; }
  .content, .topbar, .foot { padding-left: 16px; padding-right: 16px; }
  .actions { flex-wrap: wrap; }
}
