/* ============================================================
   云职聘 · 管理后台样式
   设计基调：深色侧栏 + 浅色内容区，信息密度接近办公系统，
   不做花哨装饰，保证表格、表单在 1366px 办公本上依然清晰。
   ============================================================ */

:root {
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-soft: #eff4ff;
  --ink: #111827;
  --ink-2: #374151;
  --ink-3: #6b7280;
  --ink-4: #9ca3af;
  --line: #e5e7eb;
  --line-soft: #f1f2f4;
  --bg: #f5f7fa;
  --white: #ffffff;
  --green: #16a34a;
  --green-soft: #ecfdf5;
  --amber: #d97706;
  --amber-soft: #fffbeb;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --violet: #7c3aed;
  --violet-soft: #f5f3ff;
  --radius: 12px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow: 0 6px 24px rgba(16, 24, 40, .08);
  --shadow-lg: 0 18px 48px rgba(16, 24, 40, .16);
  --sidebar: 232px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); }

button, input, select, textarea {
  font-family: inherit;
  font-size: 14px;
  color: inherit;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #d5d9e0; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  background: #0b1220;
}

.login-brand {
  position: relative;
  padding: 56px 64px;
  color: #e5edff;
  background:
    radial-gradient(900px 420px at 12% 8%, rgba(37, 99, 235, .55), transparent 62%),
    radial-gradient(700px 420px at 88% 92%, rgba(124, 58, 237, .45), transparent 60%),
    linear-gradient(160deg, #0b1220 0%, #101a33 55%, #0b1220 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.login-brand::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 30% 20%, #000 0%, transparent 72%);
  pointer-events: none;
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .5px;
  position: relative;
  z-index: 1;
}

.login-logo small { display: block; font-size: 10.5px; color: #7d8caa; font-weight: 400; letter-spacing: 1.6px; margin-top: 3px; }

.login-logo .mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, #3b82f6, #7c3aed);
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 8px 20px rgba(59, 130, 246, .45);
}

.login-copy { position: relative; z-index: 1; }
.login-copy h1 {
  margin: 0 0 14px;
  font-size: 34px;
  line-height: 1.28;
  letter-spacing: -0.5px;
  font-weight: 600;
}
.login-copy p { margin: 0; color: #9fb1d0; line-height: 1.9; font-size: 14px; max-width: 460px; }

.login-points { display: flex; gap: 10px; margin-top: 28px; flex-wrap: wrap; }
.login-points span {
  font-size: 12px;
  color: #b9c8e4;
  border: 1px solid rgba(148, 176, 226, .28);
  background: rgba(148, 176, 226, .08);
  padding: 6px 12px;
  border-radius: 999px;
}

.login-foot { position: relative; z-index: 1; font-size: 12px; color: #7d8caa; line-height: 1.9; }
.login-foot a { color: #9fb1d0; }

.login-side {
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

.login-card { width: 100%; max-width: 356px; }
.login-card h2 { margin: 0 0 6px; font-size: 22px; font-weight: 600; }
.login-card .sub { margin: 0 0 26px; color: var(--ink-3); font-size: 13px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 7px; }
.field input, .field select, .field textarea {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fbfcfd;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.field textarea { height: auto; min-height: 88px; padding: 10px 12px; line-height: 1.7; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.field .hint { margin-top: 6px; font-size: 12px; color: var(--ink-4); }

/* 表单栅格：后台录入信息那种一屏两列 / 三列的排版 */
.form2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.form3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
.field .req {
  margin-left: 4px;
  font-size: 11px;
  color: var(--red);
  background: var(--red-soft);
  border-radius: 4px;
  padding: 1px 5px;
}

/* 分段选择（招聘 / 房屋） */
.seg { display: inline-flex; gap: 3px; padding: 3px; background: #f3f4f6; border-radius: 10px; }
.seg-btn {
  border: 0;
  background: transparent;
  color: var(--ink-3);
  font-size: 13px;
  padding: 7px 16px;
  border-radius: 8px;
  cursor: pointer;
}
.seg-btn:hover { color: var(--ink); }
.seg-btn.active { background: #fff; color: var(--brand); font-weight: 500; box-shadow: var(--shadow-sm); }

/* 图片上传格子：三张缩略图 + 一个虚线「＋」 */
.up-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.up-thumb {
  position: relative;
  width: 84px;
  height: 84px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #f6f7f9 center/cover no-repeat;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.up-thumb .up-ph { font-size: 11px; color: var(--ink-4); padding: 0 4px; text-align: center; }
.up-thumb .up-del {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  padding: 0;
  line-height: 18px;
  border: 0;
  border-radius: 50%;
  background: rgba(17, 24, 39, .62);
  color: #fff;
  font-size: 11px;
  cursor: pointer;
}
.up-thumb .up-del:hover { background: var(--red); }
.up-add {
  width: 84px;
  height: 84px;
  border-radius: 10px;
  border: 1px dashed var(--line);
  background: #fbfcfd;
  color: var(--ink-4);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}
.up-add span { font-size: 18px; line-height: 1; }
.up-add em { font-style: normal; font-size: 11px; }
.up-add:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }


.login-err {
  display: none;
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 13px;
  border: 1px solid #fecaca;
}
.login-err.show { display: block; }

.btn-block { width: 100%; height: 44px; }

/* ---------- 框架 ---------- */
.app { display: none; min-height: 100vh; }
.app.ready { display: block; }

.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar);
  background: linear-gradient(180deg, #0f172a 0%, #111c33 100%);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  z-index: 20;
}

.sb-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px 18px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  letter-spacing: .3px;
}
.sb-logo .mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(135deg, #3b82f6, #7c3aed);
  display: grid; place-items: center;
  font-size: 15px; font-weight: 700;
}
.sb-logo small { display: block; font-size: 11px; color: #7d8caa; font-weight: 400; letter-spacing: 1px; margin-top: 2px; }

.sb-nav { flex: 1; overflow-y: auto; padding: 6px 10px 20px; }
.sb-group { padding: 16px 10px 7px; font-size: 11px; color: #64748b; letter-spacing: 1.4px; }
.sb-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  color: #cbd5e1;
  cursor: pointer;
  font-size: 13.5px;
  margin-bottom: 2px;
  transition: background .15s, color .15s;
  user-select: none;
}
.sb-item:hover { background: rgba(148, 163, 184, .12); color: #fff; }
.sb-item.active { background: var(--brand); color: #fff; box-shadow: 0 8px 18px rgba(37, 99, 235, .32); }
.sb-item .ic { width: 17px; text-align: center; font-size: 15px; opacity: .95; }
.sb-item .badge {
  margin-left: auto;
  min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 999px;
  background: #ef4444; color: #fff;
  font-size: 11px; line-height: 19px; text-align: center;
}
.sb-item.active .badge { background: rgba(255, 255, 255, .28); }

.sb-foot { padding: 14px 18px; border-top: 1px solid rgba(148, 163, 184, .14); font-size: 11px; color: #64748b; line-height: 1.8; }
.sb-foot a { color: #94a3b8; }

.main { margin-left: var(--sidebar); min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  height: 60px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 15;
}
.topbar h2 { margin: 0; font-size: 16px; font-weight: 600; }
.topbar .crumb { color: var(--ink-4); font-size: 12.5px; }
.topbar .spacer { flex: 1; }

.who { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #7c3aed);
  color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 600;
}
.who .name { font-size: 13px; font-weight: 500; }
.who .role { font-size: 11.5px; color: var(--ink-4); }

.content { padding: 20px 24px 40px; flex: 1; }

/* ---------- 通用组件 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
  font-size: 13px;
}
.btn:hover { border-color: #cbd5e1; background: #fafbfc; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.danger { color: var(--red); border-color: #fecaca; background: var(--red-soft); }
.btn.danger:hover { background: #fee2e2; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--line-soft); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 16px; }
.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line-soft);
}
.card-head h3 { margin: 0; font-size: 14.5px; font-weight: 600; }
.card-head .sub { font-size: 12px; color: var(--ink-4); }
.card-head .spacer { flex: 1; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }

.grid { display: grid; gap: 14px; }
.grid.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.kpi { padding: 16px 18px; }
.kpi .label { font-size: 12.5px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.kpi .value { font-size: 27px; font-weight: 650; letter-spacing: -0.6px; margin: 8px 0 4px; font-variant-numeric: tabular-nums; }
.kpi .foot { font-size: 12px; color: var(--ink-4); }
.kpi .foot b { color: var(--ink-2); font-weight: 600; }
.kpi .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
.toolbar .grow { flex: 1; }
.input, .select {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }
.input.w220 { width: 220px; }
.input.w160 { width: 160px; }
.select { padding-right: 26px; }

.tabs { display: flex; gap: 4px; padding: 0 18px; border-bottom: 1px solid var(--line-soft); overflow-x: auto; }
.tab {
  padding: 12px 14px 11px;
  font-size: 13.5px;
  color: var(--ink-3);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  user-select: none;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 500; }
.tab .n { color: var(--ink-4); font-size: 12px; margin-left: 4px; }
.tab.active .n { color: var(--brand); }

table.tb { width: 100%; border-collapse: collapse; }
table.tb th, table.tb td { padding: 12px 14px; text-align: left; vertical-align: middle; }
table.tb th {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-3);
  background: #fafbfc;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.tb td { border-bottom: 1px solid var(--line-soft); font-size: 13px; color: var(--ink-2); }
table.tb tbody tr:hover td { background: #fbfcfe; }
table.tb tbody tr:last-child td { border-bottom: none; }
table.tb .nowrap { white-space: nowrap; }
table.tb .num { font-variant-numeric: tabular-nums; }
table.tb .main-cell { max-width: 320px; }
table.tb .main-cell .t { color: var(--ink); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.tb .main-cell .s { color: var(--ink-4); font-size: 12px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.tb .ops { display: flex; gap: 6px; flex-wrap: wrap; }
/* 会员号下面那行小字（用户 ID） */
table.tb .sub-line { margin-top: 2px; font-size: 11.5px; color: var(--ink-4); }

/* 用户列表头像：圆形缩略图，占位图与真图同尺寸，行高不跳 */
table.tb .u-ava-cell { width: 56px; padding-right: 0; }
table.tb th.u-ava-cell { padding-right: 14px; }
.u-ava {
  display: block;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: #eef1f5;
  border: 1px solid var(--line-soft);
  flex: 0 0 auto;
}
/* 窄屏表格横向滑动，不挤压列宽；头像随之略缩 */
.tb-wrap { width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 900px) {
  /* 横向滑动的表格不能把外层撑宽（否则整页左右晃） */
  .content { min-width: 0; }
  .tb-wrap table.tb { min-width: 820px; }
  .u-ava { width: 30px; height: 30px; }
  table.tb .u-ava-cell { width: 48px; }
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1;
  background: var(--line-soft);
  color: var(--ink-3);
  white-space: nowrap;
}
.tag.blue { background: var(--brand-soft); color: var(--brand-dark); }
.tag.green { background: var(--green-soft); color: var(--green); }
.tag.amber { background: var(--amber-soft); color: var(--amber); }
.tag.red { background: var(--red-soft); color: var(--red); }
.tag.violet { background: var(--violet-soft); color: var(--violet); }
.tag.gray { background: #f3f4f6; color: var(--ink-3); }

.empty { padding: 56px 20px; text-align: center; color: var(--ink-4); }
.empty .ic { font-size: 30px; opacity: .5; margin-bottom: 10px; }
.empty .t { font-size: 14px; color: var(--ink-3); margin-bottom: 4px; }
.empty .s { font-size: 12.5px; }

.loading { padding: 40px; text-align: center; color: var(--ink-4); font-size: 13px; }
.sk { background: linear-gradient(90deg, #f1f3f6 25%, #e9ecf1 37%, #f1f3f6 63%); background-size: 400% 100%; animation: sk 1.3s ease infinite; border-radius: 6px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.pager { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--line-soft); }
.pager .info { color: var(--ink-4); font-size: 12.5px; }
.pager .spacer { flex: 1; }

/* 图表 */
.chart { padding: 6px 4px 0; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 186px; padding: 10px 4px 0; }
.bars .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; height: 100%; min-width: 0; }
.bars .pair { display: flex; align-items: flex-end; gap: 3px; width: 100%; height: 100%; justify-content: center; }
.bars .bar { width: 40%; max-width: 16px; border-radius: 4px 4px 2px 2px; min-height: 2px; transition: height .3s ease; position: relative; }
.bars .bar.b1 { background: linear-gradient(180deg, #60a5fa, #3b82f6); }
.bars .bar.b2 { background: linear-gradient(180deg, #a78bfa, #7c3aed); }
.bars .bar.b3 { background: linear-gradient(180deg, #34d399, #10b981); }
.bars .lb { font-size: 11px; color: var(--ink-4); white-space: nowrap; transform: scale(.92); }
.legend { display: flex; gap: 16px; padding: 6px 4px 12px; font-size: 12.5px; color: var(--ink-3); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 6px; }

.hbars { display: flex; flex-direction: column; gap: 12px; }
.hbars .row { display: grid; grid-template-columns: 108px 1fr 56px; align-items: center; gap: 10px; font-size: 13px; }
.hbars .name { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbars .track { height: 8px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.hbars .fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #60a5fa, #2563eb); }
.hbars .val { text-align: right; color: var(--ink-3); font-variant-numeric: tabular-nums; font-size: 12.5px; }

.todo-list { display: flex; flex-direction: column; }
.todo-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 18px; border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
}
.todo-item:last-child { border-bottom: none; }
.todo-item:hover { background: #fbfcfe; }
.todo-item .ic {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); font-size: 14px;
}
.todo-item .tx { flex: 1; }
.todo-item .tx .t { font-size: 13.5px; color: var(--ink); }
.todo-item .tx .s { font-size: 12px; color: var(--ink-4); margin-top: 2px; }
.todo-item .n { font-size: 17px; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.todo-item.zero .n { color: var(--ink-4); font-weight: 500; }

/* 抽屉 / 弹窗 */
.overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .38);
  opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 40;
  backdrop-filter: blur(1px);
}
.overlay.show { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 520px; max-width: 92vw;
  background: #fff; box-shadow: var(--shadow-lg); z-index: 41;
  transform: translateX(102%); transition: transform .24s cubic-bezier(.3, .8, .4, 1);
  display: flex; flex-direction: column;
}
.drawer.show { transform: translateX(0); }
.drawer.wide { width: 680px; }
.drawer-head { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; gap: 12px; }
.drawer-head h3 { margin: 0; font-size: 16px; font-weight: 600; }
.drawer-head .sub { margin-top: 4px; font-size: 12.5px; color: var(--ink-4); }
.drawer-head .x { margin-left: auto; cursor: pointer; color: var(--ink-4); font-size: 18px; line-height: 1; padding: 2px 4px; border-radius: 6px; }
.drawer-head .x:hover { background: var(--line-soft); color: var(--ink); }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px; }
.drawer-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; background: #fcfcfd; }

.dl { display: grid; grid-template-columns: 92px 1fr; gap: 10px 12px; font-size: 13px; }
.dl dt { color: var(--ink-4); }
.dl dd { margin: 0; color: var(--ink-2); word-break: break-word; }

.section-title { font-size: 12.5px; color: var(--ink-4); letter-spacing: .6px; margin: 20px 0 10px; }
.section-title:first-child { margin-top: 0; }

.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat-grid .it { background: #fafbfc; border: 1px solid var(--line-soft); border-radius: 10px; padding: 12px; text-align: center; }
.stat-grid .it .v { font-size: 19px; font-weight: 650; font-variant-numeric: tabular-nums; }
.stat-grid .it .k { font-size: 11.5px; color: var(--ink-4); margin-top: 3px; }

.modal {
  position: fixed; z-index: 42; left: 50%; top: 50%; transform: translate(-50%, -48%) scale(.98);
  width: 460px; max-width: 94vw; background: #fff; border-radius: 14px;
  box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: all .18s;
  max-height: 88vh; display: flex; flex-direction: column;
}
.modal.show { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.modal-head { padding: 18px 20px 0; font-size: 16px; font-weight: 600; }
.modal-body { padding: 16px 20px; overflow-y: auto; }
.modal-foot { padding: 0 20px 18px; display: flex; gap: 8px; justify-content: flex-end; }

.toast-wrap { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  padding: 10px 18px; border-radius: 10px; background: #111827; color: #fff; font-size: 13px;
  box-shadow: var(--shadow-lg); animation: toastIn .2s ease; max-width: 70vw;
}
.toast.ok { background: #065f46; }
.toast.err { background: #991b1b; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.muted { color: var(--ink-4); }
.small { font-size: 12px; }
.right { text-align: right; }
.flex { display: flex; align-items: center; gap: 8px; }
.wrap { flex-wrap: wrap; }
.hr { height: 1px; background: var(--line-soft); margin: 16px 0; }
.pill-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { font-size: 12px; color: var(--ink-3); background: #f6f7f9; border-radius: 999px; padding: 5px 11px; }
.pill b { color: var(--ink); font-weight: 600; }

.app-foot { padding: 18px 24px 26px; text-align: center; color: var(--ink-4); font-size: 12px; line-height: 1.9; }
.app-foot a { color: var(--ink-3); }

.split-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; align-items: start; }

.thumb-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.thumb-grid .th { aspect-ratio: 1; border-radius: 8px; border: 1px solid var(--line); background: #f6f7f9 center/cover no-repeat; overflow: hidden; display: grid; place-items: center; color: var(--ink-4); font-size: 11px; }
.thumb-grid .th img { width: 100%; height: 100%; object-fit: cover; display: block; }

.desc-box { background: #fafbfc; border: 1px solid var(--line-soft); border-radius: 10px; padding: 12px; font-size: 13px; color: var(--ink-2); line-height: 1.85; white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow-y: auto; }

@media (max-width: 1180px) {
  .grid.g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split-2 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .form2, .form3 { grid-template-columns: 1fr; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .sidebar { transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .grid.g3, .grid.g4 { grid-template-columns: 1fr; }
}

/* ---------- 导出面板（公众号 / 群聊）---------- */
.ex-mode { display: flex; gap: 6px; margin-bottom: 16px; }
.ex-mode .tab {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--line);
}
.ex-mode .tab.active { border-color: var(--brand); color: var(--brand); background: rgba(37, 99, 235, .06); }
.field .flex .input { width: 150px; flex: 0 0 150px; }
.ex-preview {
  max-height: 46vh;
  overflow: auto;
  background: #f8fafc;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 12px;
}
.ex-item { padding: 10px 0; border-bottom: 1px dashed var(--line-soft); }
.ex-item:last-child { border-bottom: 0; }
.ex-meta { font-size: 11.5px; color: var(--ink-3); margin-bottom: 6px; }
.ex-preview pre {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.85;
  color: var(--ink-2);
  white-space: pre-wrap;
  word-break: break-word;
  /* 预览里的对齐靠全角空格，字体必须让汉字与全角空格同宽，否则冒号会错位 */
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Heiti SC", monospace;
  letter-spacing: 0;
  tab-size: 2;
}

/* 导出预览：每条右上角的「改」 */
.ex-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ex-head .ex-meta { flex: 1; margin-bottom: 0; min-width: 0; }
.ex-edit {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  border-radius: 6px;
  padding: 2px 10px;
  font-size: 12px;
  cursor: pointer;
}
.ex-edit:hover { border-color: var(--brand); color: var(--brand); }
