* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Microsoft YaHei", "PingFang SC", sans-serif; background: #f0f2f5; color: #222; }
.hidden { display: none !important; }
.muted { color: #888; font-size: 13px; }
.flex-grow { flex: 1; }

/* 登录 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { background: #fff; padding: 40px 36px; border-radius: 12px; width: 340px;
  box-shadow: 0 6px 24px rgba(0,0,0,.08); text-align: center; }
.login-logo { font-size: 40px; }
.login-card h2 { margin: 10px 0 24px; font-size: 18px; }
.login-card input { width: 100%; padding: 10px 12px; border: 1px solid #ddd; border-radius: 8px;
  margin-bottom: 14px; font-size: 14px; }
.login-err { color: #e34d59; font-size: 13px; margin-top: 10px; min-height: 18px; }

/* 按钮 */
.btn { border: none; border-radius: 8px; padding: 8px 16px; font-size: 14px; cursor: pointer;
  text-decoration: none; display: inline-block; }
.btn.primary { background: #2f6fed; color: #fff; }
.btn.primary:hover { background: #255fd0; }
.btn.ghost { background: #fff; border: 1px solid #ddd; color: #555; }
.btn.danger { background: #e34d59; color: #fff; }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn.block { width: 100%; }

/* 布局 */
.topbar { background: #1f2d3d; color: #fff; padding: 0 24px; height: 52px;
  display: flex; align-items: center; justify-content: space-between; }
.brand { font-size: 16px; font-weight: bold; }
.topbar .btn.ghost { background: transparent; border-color: #556; color: #ccc; }
.tabs { background: #fff; padding: 0 24px; display: flex; gap: 4px;
  justify-content: center; border-bottom: 1px solid #e5e6eb; }
.tab { border: none; background: none; padding: 14px 18px; font-size: 14px; cursor: pointer;
  color: #666; border-bottom: 2px solid transparent; }
.tab.active { color: #2f6fed; border-bottom-color: #2f6fed; font-weight: bold; }
.main { padding: 20px 24px; max-width: 1200px; margin: 0 auto; }

/* 概览 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.stat-card { background: #fff; border-radius: 12px; padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.stat-card .num { font-size: 28px; font-weight: bold; color: #2f6fed; }
.stat-card .label { color: #888; font-size: 13px; margin-top: 4px; }

/* 工具条 */
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; align-items: center; flex-wrap: wrap; }
.toolbar input, .toolbar select { padding: 8px 10px; border: 1px solid #ddd; border-radius: 8px; font-size: 13px; }
.toolbar input { width: 200px; }

/* 表格 */
.table-wrap { background: #fff; border-radius: 12px; overflow: auto; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #f0f0f0;
  vertical-align: middle; }
th { background: #fafafa; color: #666; white-space: nowrap; }
td .stem-cell { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }

/* 学员列表：表头与数据行统一高度（数据行被 26px 的按钮撑高，表头需手动齐平），
   单元格内文字行高与 22px 标签一致，使文字、标签、按钮共用同一条垂直中心线 */
#user-table th { height: 46px; }
#user-table th, #user-table td { line-height: 22px; vertical-align: middle; }
/* 全表水平居中：表头与内容都按列中线对称，标签 / 按钮的内边距偏移随之消失 */
#user-table th, #user-table td { text-align: center; }
#user-table td .op-cell { min-height: 26px; justify-content: center; }
.tag { background: #eef3ff; color: #2f6fed; border-radius: 4px; padding: 2px 6px; font-size: 12px; }
tr:hover td { background: #fafbff; }
.pager { display: flex; gap: 14px; align-items: center; justify-content: center; margin: 16px 0; color: #666; font-size: 13px; }

/* 导入导出 */
.io-card { background: #fff; border-radius: 12px; padding: 22px; margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.io-card h3 { margin-bottom: 8px; font-size: 15px; }
.io-card p { margin-bottom: 12px; line-height: 1.7; }
.io-card input[type=file] { margin-right: 12px; }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100;
  display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow: auto; }
.modal { background: #fff; border-radius: 12px; width: 560px; max-width: 100%; padding: 24px; }
.modal h3 { margin-bottom: 14px; }
.modal label { display: block; font-size: 13px; color: #666; margin: 12px 0 6px; }
.modal input, .modal select, .modal textarea { width: 100%; padding: 8px 10px; border: 1px solid #ddd;
  border-radius: 8px; font-size: 13px; font-family: inherit; }
.modal .opt-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.modal .opt-row span { color: #2f6fed; font-weight: bold; width: 18px; }
.modal-foot { margin-top: 20px; text-align: right; display: flex; gap: 10px; justify-content: flex-end; }

/* 站点设置 */
.setting-row { margin: 16px 0; max-width: 520px; }
.setting-row label { display: block; font-size: 13px; color: #333; font-weight: 600; margin-bottom: 6px; }
.setting-row label em { display: block; font-style: normal; font-weight: 400;
  font-size: 12px; color: #999; margin-top: 3px; }
.setting-row input { width: 100%; padding: 9px 12px; border: 1px solid #ddd;
  border-radius: 8px; font-size: 14px; font-family: inherit; }
.setting-row select { width: 100%; padding: 9px 12px; border: 1px solid #ddd;
  border-radius: 8px; font-size: 14px; font-family: inherit; background: #fff; }
.setting-row select:focus { outline: none; border-color: #2f6fed; box-shadow: 0 0 0 3px rgba(47,111,237,.12); }
.setting-row textarea { width: 100%; box-sizing: border-box; padding: 9px 12px; border: 1px solid #ddd;
  border-radius: 8px; font-size: 14px; font-family: inherit; line-height: 1.6; resize: vertical; }
.setting-row textarea:focus { outline: none; border-color: #2f6fed; box-shadow: 0 0 0 3px rgba(47,111,237,.12); }
.setting-row input:focus { outline: none; border-color: #2f6fed; box-shadow: 0 0 0 3px rgba(47,111,237,.12); }

/* 会员设置：价格与联系文案一行三项 */
.price-row { display: flex; gap: 16px; flex-wrap: wrap; margin: 16px 0; }
.price-item { flex: 1 1 200px; min-width: 170px; }
.price-item label { display: block; font-size: 13px; color: #333; font-weight: 600; margin-bottom: 6px; }
.price-item label em { display: block; font-style: normal; font-weight: 400;
  font-size: 12px; color: #999; margin-top: 3px; }
.price-item input { width: 100%; box-sizing: border-box; padding: 9px 12px;
  border: 1px solid #ddd; border-radius: 8px; font-size: 14px; font-family: inherit; }
.price-item input:focus { outline: none; border-color: #2f6fed; box-shadow: 0 0 0 3px rgba(47,111,237,.12); }

/* 会员管理：二维码预览 */
.qr-preview { width: 110px; height: 110px; object-fit: contain; border: 1px solid #e3e6ee; border-radius: 8px; background: #fafbfe; }

/* 首页轮播管理 */
.bn-thumb {
  display: block; width: 110px; height: 50px; border-radius: 6px;
  object-fit: cover; border: 1px solid #e3e6ee; background: #f5f6fa;
}
.bn-thumb-ph {
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 12px; letter-spacing: 1px;
}
.banner-img-row { display: flex; align-items: center; gap: 8px; }
.banner-img-row input { flex: 1; min-width: 0; background: #f7f8fb; color: #6b7280; }
.banner-preview {
  display: block; width: 260px; height: 124px; object-fit: cover;
  border-radius: 8px; border: 1px solid #e3e6ee; margin-top: 10px;
}
/* 跳转路径提示：长路径允许强制折行，避免超出弹窗 */
.hint-paths { word-break: break-all; line-height: 1.7; font-size: 12px; }

/* 试用额度：四项排一行 */
/* 模式与额度：顶部模式条 + 三组额度小卡 */
.mode-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 2px 0 8px; }
.mode-label { font-size: 13px; font-weight: 600; color: #333; }
.mode-select { width: 340px; padding: 8px 10px; border: 1px solid #ddd; border-radius: 8px;
  font-size: 13px; font-family: inherit; background: #fff; }
.mode-select:focus { outline: none; border-color: #2f6fed; box-shadow: 0 0 0 3px rgba(47,111,237,.12); }
.card-hint { font-size: 12px; color: #8d94a3; line-height: 1.7; margin: 0; }
.limit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px; margin: 14px 0 10px; }
.limit-group { border: 1px solid #eef1f6; background: #fbfcfe; border-radius: 10px; padding: 12px 14px 14px; }
.lg-title { font-size: 12px; font-weight: 700; color: #5b6478; margin-bottom: 10px; }
.lg-fields { display: flex; gap: 12px; }
.lg-note { font-size: 11px; color: #9aa0ab; margin-top: 8px; }
/* 第三组只有「赠送天数」一个字段，限制宽度免得单个输入框被拉成一整行 */
.limit-group:last-child .lg-fields { max-width: 150px; }
.limit-item { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.limit-item label { font-size: 12px; font-weight: 500; color: #6b7280; }
.limit-item input { width: 100%; box-sizing: border-box; padding: 8px 10px;
  border: 1px solid #dfe3ec; border-radius: 6px; font-size: 14px; font-family: inherit; }
.limit-item input:focus { outline: none; border-color: #2f6fed; box-shadow: 0 0 0 3px rgba(47,111,237,.1); }
.limit-foot { display: flex; align-items: center; gap: 12px; margin-top: 12px; }

/* 卡密管理：生成区与列表之间的分隔线 */
.card-divider { height: 1px; background: #eceff5; margin: 16px 0 14px; }

/* 轻提示：复制 / 生成 / 删除反馈 */
.toast {
  position: fixed; left: 50%; top: 22px; transform: translate(-50%, -10px);
  background: #222; color: #fff; padding: 10px 18px; border-radius: 8px;
  font-size: 13px; line-height: 1.4; max-width: 80vw; z-index: 999;
  opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s;
  box-shadow: 0 6px 20px rgba(0,0,0,.18);
}
.toast.show { opacity: .94; transform: translate(-50%, 0); }

/* 操作列：按钮自动换行不挤（必须是 td 内的 div，直接给 td 加 flex 会破坏表格对齐） */
.op-cell { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.op-cell .btn.sm { height: 26px; line-height: 1; padding: 0 10px;
  display: inline-flex; align-items: center; justify-content: center; }
.op-cell .btn.sm.arrow { width: 26px; padding: 0; font-size: 13px; }
/* 会员类型标签 */
.vip-tag {
  display: inline-flex; align-items: center; height: 22px; padding: 0 10px;
  border-radius: 999px; font-size: 12px; line-height: 1; font-weight: 600;
  color: #8a6a12; background: #fdf3d8; border: 1px solid #f2dfa8;
  white-space: nowrap; vertical-align: middle;
}
/* 卡密列表 / 轮播列表：启用停用状态标签 */
.state-tag {
  display: inline-flex; align-items: center; height: 22px; padding: 0 10px;
  border-radius: 999px; font-size: 12px; line-height: 1; font-weight: 600;
  white-space: nowrap; vertical-align: middle;
}
.state-tag.on { color: #1a7f45; background: #e6f7ee; border: 1px solid #b7e4c9; }
.state-tag.off { color: #8b8f98; background: #f2f3f6; border: 1px solid #e2e4e9; }
.state-tag.dead { color: #b3261e; background: #fdecea; border: 1px solid #f5c2be; }
.state-tag.warn { color: #8a5a00; background: #fff4e0; border: 1px solid #f3d9a5; }
#user-modal .modal input[readonly], #user-modal .modal input:disabled { background: #f5f6f8; color: #9aa0ab; }

/* 弹窗里的「到期时间 + 关闭会员」一行 */
.expire-row { display: flex; align-items: center; gap: 10px; }
.expire-row input { flex: 1; min-width: 0; }
/* 报考类别行：两个下拉 + 法人A 勾选，勾选框不能被拉伸 */
.expire-row select { flex: 1; min-width: 0; }
.expire-row input[type="checkbox"] { flex: none; width: auto; margin: 0; }
.expire-row .btn { flex: none; white-space: nowrap; }
/* 学员编辑弹窗：姓名 + 手机号一行两列 */
.dual-row { display: flex; gap: 12px; }
.dual-row .dual-field { flex: 1; min-width: 0; }
.dual-row .dual-field label { margin-top: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- 站点设置：二级标签（一屏一张卡） ---------- */
.subtabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.subtab {
  border: 1px solid #e0e4ec; background: #fff; color: #4a5468;
  border-radius: 999px; padding: 7px 16px; font-size: 13px; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.subtab:hover { border-color: #b9cdf7; color: #2f6fed; }
.subtab.active { background: #2f6fed; border-color: #2f6fed; color: #fff; font-weight: bold; }

/* ---------- 站点设置：子页表单排版 ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 20px; }
.form-grid .setting-row { max-width: none; }
.span-2 { grid-column: 1 / -1; }
/* 小节标题：文字 + 右侧延伸细线 */
.form-sec {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 12px;
  margin: 18px 0 0; font-size: 13px; font-weight: bold; color: #333;
}
.form-sec::after { content: ""; flex: 1; height: 1px; background: #eef0f4; }
.form-foot {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 20px; padding-top: 16px; border-top: 1px solid #f0f2f6;
}
/* 行内勾选（替代裸 checkbox + 说明文字） */
.setting-row label.chk, label.chk {
  display: inline-flex; align-items: center; gap: 8px; margin: 0;
  font-size: 13px; font-weight: normal; color: #333;
}
.setting-row label.chk input, label.chk input { width: 16px; height: 16px; margin: 0; flex: none; }
/* 二维码：左预览右操作 */
.qr-line { display: flex; gap: 18px; align-items: flex-start; }
.qr-ops { flex: 1; min-width: 0; }
/* 联系二维码 / 小程序码并排一行（窄卡自动退回单列） */
.qr-duo { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
/* 维护开关条 */
.maint-switch {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border: 1px solid #eef0f4; border-radius: 10px; background: #fbfcfd;
}
.maint-switch-l { display: flex; align-items: center; gap: 10px; }
/* 按服务商分组：容器透明，子项直接参与外层网格 */
.sms-group { display: contents; }
.sms-test {
  margin-top: 18px; padding: 14px 16px; border: 1px solid #eef0f4;
  border-radius: 10px; background: #fbfcfd;
}
.sms-test-t { font-size: 13px; font-weight: bold; color: #333; margin-bottom: 10px; }
.sms-test-t em { display: block; font-style: normal; font-weight: normal; font-size: 12px; color: #999; margin-top: 3px; }

/* ---------- 系统维护 ---------- */
.maintain-bar {
  position: relative;
  display: flex; align-items: center; justify-content: flex-end; gap: 12px;
  padding: 10px 22px; background: #fdecea; color: #b3261e;
  border-bottom: 1px solid #f5c2be; font-size: 13px; font-weight: 600;
}
/* 提示文字绝对居中，按钮留在右侧 */
.maintain-bar > span {
  position: absolute; left: 50%; transform: translateX(-50%);
  white-space: nowrap; pointer-events: none;
}
.maintain-bar .btn { background: #b3261e; color: #fff; border: 0; }
.maintain-badge {
  display: inline-flex; align-items: center; height: 24px; padding: 0 12px;
  border-radius: 999px; font-size: 12px; font-weight: 600;
  color: #1a7f45; background: #e6f7ee; border: 1px solid #b7e4c9;
}
.maintain-badge.on { color: #b3261e; background: #fdecea; border-color: #f5c2be; }
