/* 大圣知识库 · 会员系统样式
   与知识库站点共用同一套品牌色，保证视觉统一 */
:root {
  --bg: #f7f7f9;
  --card: #ffffff;
  --ink: #1c1e26;
  --muted: #6b7280;
  --brand: #e85d9e;
  --brand-dark: #d94c8c;
  --brand-soft: #fdeef5;
  --accent: #7c6cf0;
  --line: #e7e8ee;
  --ok: #15803d;
  --warn: #b45309;
  --danger: #b91c1c;
  --radius: 12px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  font-size: 15px;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: .94em;
}
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hint { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 16px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 800; font-size: 17px; color: var(--brand);
  text-decoration: none; white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand-ic { vertical-align: -5px; border-radius: 6px; }
.topbar-links { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.topbar-links a {
  color: var(--ink); font-size: 14px; padding: 6px 12px; border-radius: 8px;
}
.topbar-links a:hover { background: var(--brand-soft); color: var(--brand); text-decoration: none; }
.topbar-links .link-strong { color: #fff; background: var(--brand); }
.topbar-links .link-strong:hover { background: var(--brand-dark); color: #fff; }
.who { font-size: 13px; color: var(--muted); padding: 0 6px; }

/* ---------- 登录 / 注册 ---------- */
.page-auth { background: radial-gradient(1100px 520px at 18% -12%, #fdeef5 0%, #f7f7f9 58%); }
.auth-wrap {
  min-height: calc(100vh - 58px);
  display: grid; place-items: center;
  padding: 42px 16px 64px;
}
.auth-card {
  width: 100%; max-width: 404px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 30px 30px 26px;
  box-shadow: 0 18px 50px rgba(34, 20, 58, .08);
}
.auth-head { text-align: center; margin-bottom: 22px; }
.auth-logo { margin-bottom: 8px; }
.auth-title { margin: 0 0 6px; font-size: 23px; letter-spacing: .01em; }
.auth-sub { margin: 0; color: var(--muted); font-size: 13.5px; }
.auth-foot { text-align: center; color: var(--muted); font-size: 13.5px; margin: 18px 0 0; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 15px; }
.field > label {
  display: block; font-size: 13px; font-weight: 600;
  color: #3d4152; margin-bottom: 6px;
}
.field input, .field select {
  width: 100%; height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 15px; color: var(--ink);
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(232, 93, 158, .13);
}
.field input:disabled { background: #f4f4f7; color: var(--muted); }
.captcha-row { display: flex; gap: 10px; align-items: stretch; }
.captcha-row input { flex: 1; min-width: 0; }
.captcha-img {
  width: 132px; height: 44px; flex: none;
  border: 1px solid var(--line); border-radius: 10px;
  cursor: pointer; background: #fff; object-fit: cover;
}
.captcha-img:hover { border-color: var(--brand); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 42px; padding: 0 18px;
  border-radius: 10px; border: 1px solid transparent;
  font-size: 15px; font-weight: 600; font-family: inherit;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-danger-ghost { background: #fff; border-color: #f3c6c6; color: var(--danger); }
.btn-danger-ghost:hover { background: #fef2f2; border-color: #ef9a9a; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.inline { display: inline; margin: 0; }
.acts { white-space: nowrap; }
.acts .btn, .acts .inline { vertical-align: middle; }
.acts .btn { margin: 2px 4px 2px 0; }

/* ---------- 提示条 ---------- */
.alert {
  padding: 10px 14px; border-radius: 10px;
  font-size: 14px; line-height: 1.65;
  margin: 0 0 14px;
  border: 1px solid transparent;
}
.alert-error { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.alert-ok { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.alert-warn { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.alert-info { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }

/* ---------- 会员中心 ---------- */
.member-wrap { max-width: 840px; margin: 0 auto; padding: 28px 18px 70px; }
.member-head { margin-bottom: 18px; }
.member-head h1 { margin: 0 0 2px; font-size: 25px; }
.member-head p { margin: 0; }
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 18px;
}
.panel-title {
  font-weight: 700; font-size: 15px;
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.panel-more { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.panel-more:hover { color: var(--brand); text-decoration: none; }
.kv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kv {
  background: var(--bg); border-radius: 10px;
  padding: 10px 14px; display: flex; flex-direction: column; gap: 1px;
}
.kv span { font-size: 12px; color: var(--muted); }
.kv b { font-size: 15px; font-weight: 600; }
.kv-list { list-style: none; padding: 0; margin: 0; }
.kv-list li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px;
}
.kv-list li:last-child { border-bottom: none; }
.kv-list span { color: var(--muted); }
.log-list { list-style: none; padding: 0; margin: 0; }
.log-list li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px;
}
.log-list li:last-child { border-bottom: none; }
.pass-form { max-width: 400px; }

/* ---------- 后台骨架 ---------- */
.admin-shell {
  display: grid; grid-template-columns: 222px minmax(0, 1fr);
  min-height: calc(100vh - 57px);
}
.admin-side {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 18px 12px;
  position: sticky; top: 57px;
  height: calc(100vh - 57px);
  overflow-y: auto;
}
.side-title {
  font-size: 12px; color: var(--muted);
  letter-spacing: .06em; padding: 0 10px 10px;
}
.side-link {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: 9px;
  color: var(--ink); font-size: 14px; text-decoration: none;
  margin-bottom: 2px;
}
.side-link:hover { background: var(--brand-soft); color: var(--brand); text-decoration: none; }
.side-link.active { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.side-num {
  margin-left: auto; font-size: 12px; line-height: 1.6;
  background: #eef0f4; color: #555;
  border-radius: 999px; padding: 0 8px;
}
.side-num.hot { background: var(--brand); color: #fff; }
.side-foot {
  margin-top: 22px; padding: 12px 10px 0;
  border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--muted); line-height: 1.9;
}
.admin-main { padding: 24px 26px 70px; min-width: 0; }
.admin-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 18px;
}
.admin-head h1 { margin: 0; font-size: 22px; }
.admin-head-actions { display: flex; gap: 8px; }

/* ---------- 统计卡 ---------- */
.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: 12px; margin-bottom: 20px;
}
.stat-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 15px 17px;
  display: flex; flex-direction: column; gap: 1px;
  color: var(--ink); text-decoration: none;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.stat-card:hover {
  border-color: var(--brand); text-decoration: none;
  box-shadow: 0 8px 22px rgba(232, 93, 158, .1);
  transform: translateY(-1px);
}
.stat-hot { background: linear-gradient(160deg, #fdeef5, #fff 60%); border-color: #f7cfe2; }
.stat-num { font-size: 28px; font-weight: 800; line-height: 1.25; }
.stat-label { font-size: 13px; color: var(--muted); }

/* ---------- 两栏 ---------- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px; align-items: start; }

/* ---------- 工具栏 / 筛选 ---------- */
.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center;
  height: 32px; padding: 0 13px;
  border: 1px solid var(--line); border-radius: 999px;
  background: #fff; color: #444; font-size: 13px;
  cursor: pointer; text-decoration: none; font-family: inherit;
}
.chip:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.search-form { display: flex; gap: 6px; align-items: center; }
.search-input {
  height: 34px; padding: 0 12px; width: 180px;
  border: 1px solid var(--line); border-radius: 9px;
  font-size: 14px; font-family: inherit; outline: none;
}
.search-input:focus { border-color: var(--brand); }

/* ---------- 表格 ---------- */
.tbl-wrap {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow-x: auto;
}
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th {
  text-align: left; white-space: nowrap;
  padding: 12px 14px;
  background: #fafafc; color: #5a5f70;
  font-size: 12.5px; font-weight: 600;
  border-bottom: 1px solid var(--line);
}
.tbl td { padding: 12px 14px; border-bottom: 1px solid #f1f2f6; vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: #fcfcfe; }
.tbl .row-pending { background: #fffdf5; }
.tbl .row-pending:hover { background: #fffbe9; }
.th-acts { min-width: 220px; }
.sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.empty { text-align: center; color: var(--muted); padding: 44px 12px; }
.tbl-compact td, .tbl-compact th { padding: 9px 12px; font-size: 13px; }
.left-days { font-weight: 700; color: var(--ok); }
.left-days.warn { color: var(--warn); }
.left-days.over { color: var(--danger); }

/* ---------- 状态徽章 ---------- */
.badge {
  display: inline-block; padding: 2px 9px;
  border-radius: 999px; font-size: 12px; font-weight: 600;
  line-height: 1.7; white-space: nowrap;
}
.badge-ok { background: #e8f8ee; color: var(--ok); }
.badge-warn { background: #fff4df; color: var(--warn); }
.badge-danger { background: #fdecec; color: var(--danger); }
.badge-muted { background: #eef0f4; color: #556; }

/* ---------- 小列表 ---------- */
.mini-list { list-style: none; padding: 0; margin: 0; }
.mini-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px dashed var(--line);
  font-size: 13.5px;
}
.mini-list li:last-child { border-bottom: none; }
.mini-list .btn { margin-left: auto; }
.mini-list.plain li { justify-content: flex-start; }
.mini-list.plain li .muted { margin-left: auto; }
.log-act { font-weight: 600; }

/* ---------- 分页 ---------- */
.pager {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; margin-top: 16px; font-size: 13.5px;
}

/* ---------- 弹窗 ---------- */
.dlg {
  border: none; border-radius: 16px; padding: 24px;
  width: min(430px, calc(100vw - 32px));
  box-shadow: 0 24px 70px rgba(20, 18, 28, .28);
  color: var(--ink); font-family: inherit;
}
.dlg::backdrop { background: rgba(20, 18, 28, .45); }
.dlg h3 { margin: 0 0 4px; font-size: 18px; }
.dlg-sub { margin: 0 0 16px; color: var(--muted); font-size: 13.5px; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 0 4px; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* ---------- 内容页水印 ---------- */
.kb-watermark {
  position: fixed; right: 14px; bottom: 10px; z-index: 30;
  font-size: 12px; color: rgba(60, 50, 80, .28);
  pointer-events: none; user-select: none;
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side {
    position: static; height: auto;
    border-right: none; border-bottom: 1px solid var(--line);
    display: flex; gap: 4px; overflow-x: auto;
    padding: 10px 12px;
  }
  .side-title, .side-foot { display: none; }
  .side-link { margin: 0; white-space: nowrap; }
  .admin-main { padding: 18px 16px 60px; }
  .two-col { grid-template-columns: 1fr; }
  .kv-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 26px 20px 22px; }
  .search-input { width: 130px; }
}
@media (max-width: 560px) {
  .topbar { padding: 8px 12px; gap: 8px; }
  .brand { font-size: 15px; }
  .topbar-links a { padding: 5px 8px; font-size: 13px; }
  .tbl th, .tbl td { padding: 10px; }
}
