/* ============================================================
   在线病历生成平台 —— 全站样式
   ============================================================ */
:root {
  --c-primary: #2f6fed;
  --c-primary-dark: #1f55c4;
  --c-primary-soft: #eaf1ff;
  --c-primary-lt: #dfe9fd;
  --c-success: #12a150;
  --c-success-soft: #e7f8ee;
  --c-success-lt: #cfeedd;
  --c-danger: #e0322f;
  --c-danger-soft: #fdeceb;
  --c-warning: #d68910;
  --c-warning-soft: #fdf3e2;
  --c-info: #2b7fb8;

  --c-bg: #f4f6fa;
  --c-card: #ffffff;
  --c-border: #e3e7ee;
  --c-border-soft: #eef1f6;
  --c-text: #1b1f27;
  --c-text-sub: #5c6675;
  --c-text-mute: #939caa;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 3px rgba(20, 30, 60, .06);
  --shadow: 0 4px 16px rgba(20, 30, 60, .08);
  --shadow-lg: 0 12px 40px rgba(20, 30, 60, .14);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
  background: var(--c-bg);
  color: var(--c-text);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--c-primary); text-decoration: none; }
a:hover { color: var(--c-primary-dark); }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ---------------- 顶部导航（前台） ---------------- */
.site-header {
  background: var(--c-card);
  border-bottom: 1px solid var(--c-border);
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow-sm);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 62px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 17px; font-weight: 700; color: var(--c-text);
}
.logo:hover { color: var(--c-text); }
.logo-mark {
  display: block; width: 32px; height: 32px; flex: 0 0 32px;
  border-radius: 8px;
}
/* 站名文字：普通文字样式，不做任何 logo 化处理（无渐变/描边/字距特效） */
.logo-text {
  max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 16px; font-weight: 600; line-height: 1.2; letter-spacing: 0;
}
.site-nav { display: flex; align-items: center; gap: 6px; }
.site-nav > a {
  padding: 7px 13px; border-radius: var(--radius-sm);
  color: var(--c-text-sub); font-weight: 500;
}
.site-nav > a:hover { background: var(--c-border-soft); color: var(--c-text); }
.site-nav > a.on { background: var(--c-primary-soft); color: var(--c-primary); }
.nav-user { color: var(--c-text-sub); font-size: 13px; margin-left: 8px; text-decoration: none; transition: color .15s; }
.nav-user:hover, .nav-user.on { color: var(--c-primary); }
/* 昵称过长：截断显示，不撑爆顶栏（菜单项已 nowrap，这里是兜底） */
.site-nav > a.nav-user { max-width: 180px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* ---------------- 多级菜单（个人中心） ----------------
   桌面：hover / 点击展开下拉；≤980px 时随抽屉变成可折叠子菜单（见下方媒体查询） */
.site-nav > .nav-drop { position: relative; }
.nav-drop-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 13px; border: 0; border-radius: var(--radius-sm);
  background: none; color: var(--c-text-sub);
  font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background .15s, color .15s;
}
.nav-drop-btn:hover { background: var(--c-border-soft); color: var(--c-text); }
.nav-drop-btn.on { background: var(--c-primary-soft); color: var(--c-primary); }
.nav-drop-btn > i.nav-ic { display: none; }
.nav-caret { font-size: 14px; color: var(--c-text-mute, #8b93a7); transition: transform .18s; }
.nav-drop.open .nav-caret { transform: rotate(180deg); }
.nav-drop-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 130;
  min-width: 172px; padding: 6px;
  background: var(--c-card); border: 1px solid var(--c-border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  display: none;
}
.nav-drop.open .nav-drop-menu { display: block; }
.nav-drop-menu > a {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 11px; border-radius: var(--radius-sm);
  color: var(--c-text-sub); font-size: 13.5px; white-space: nowrap;
}
.nav-drop-menu > a:hover { background: var(--c-border-soft); color: var(--c-text); }
.nav-drop-menu > a.on { background: var(--c-primary-soft); color: var(--c-primary); }
.nav-drop-menu > a > i { font-size: 16px; }

.site-main { min-height: calc(100vh - 62px); padding: 26px 0 50px; }

/* 首页公告横幅 */
.notice-bar {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 18px; margin-bottom: 20px;
  background: var(--c-primary-soft); color: #1b4ba8;
  border: 1px solid #c2d7fb; border-radius: var(--radius);
  font-size: 14px; line-height: 1.6;
}
.notice-bar i { font-size: 17px; margin-top: 1px; flex: 0 0 auto; }
.notice-bar span, .notice-bar .notice-html { min-width: 0; overflow-wrap: anywhere; }
/* 公告允许 HTML：把富文本的首尾外边距压掉，避免横幅被撑高 */
.notice-html > :first-child { margin-top: 0; }
.notice-html > :last-child { margin-bottom: 0; }
.notice-html p, .notice-html ul, .notice-html ol, .notice-html table { margin: 0 0 6px; }
.notice-html ul, .notice-html ol { padding-left: 20px; }
.notice-html a { color: inherit; text-decoration: underline; }
.notice-html img { max-width: 100%; height: auto; vertical-align: middle; }

/* 首页公告弹窗（announce_mode = modal） */
.notice-modal {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.notice-modal[hidden] { display: none; }
.notice-mask { position: absolute; inset: 0; background: rgba(15, 23, 42, .48); }
.notice-dialog {
  position: relative; z-index: 1;
  width: 100%; max-width: 520px; max-height: calc(100vh - 40px);
  display: flex; flex-direction: column;
  background: var(--c-card); border-radius: 16px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .28);
  animation: noticeIn .18s ease-out;
}
@keyframes noticeIn {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
.notice-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px 0; }
.notice-head h2 {
  flex: 1 1 auto; min-width: 0; font-size: 16px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.notice-head h2 i { color: var(--c-primary); font-size: 18px; }
.notice-x {
  flex: 0 0 auto; width: 32px; height: 32px; border: 0; border-radius: 8px;
  background: transparent; color: var(--c-text-mute); font-size: 18px;
  display: grid; place-items: center; cursor: pointer; transition: all .15s;
}
.notice-x:hover { background: var(--c-border-soft); color: var(--c-text); }
.notice-body {
  padding: 12px 20px 4px; overflow-y: auto;
  font-size: 14px; line-height: 1.75; color: var(--c-text);
  overflow-wrap: anywhere;
}
.notice-body > :first-child { margin-top: 0; }
.notice-body > :last-child { margin-bottom: 0; }
.notice-body p, .notice-body ul, .notice-body ol { margin: 0 0 8px; }
.notice-body ul, .notice-body ol { padding-left: 20px; }
.notice-body a { color: var(--c-primary); text-decoration: underline; }
.notice-body img { max-width: 100%; height: auto; border-radius: 8px; }
.notice-foot { padding: 10px 20px 20px; display: flex; justify-content: flex-end; }
body.notice-open { overflow: hidden; }
@media (max-width: 620px) {
  .notice-modal { padding: 14px; }
  .notice-dialog { max-width: none; }
  .notice-head { padding: 16px 16px 0; }
  .notice-body { padding: 10px 16px 2px; }
  .notice-foot { padding: 8px 16px 16px; }
  .notice-foot .btn { width: 100%; }
}

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: var(--c-border-soft);
  color: var(--c-text); font-size: 14px; font-weight: 500;
  cursor: pointer; font-family: inherit; line-height: 1.4;
  transition: all .15s;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--c-primary); color: #fff; }
.btn-primary:hover { background: var(--c-primary-dark); color: #fff; }
.btn-success { background: var(--c-success); color: #fff; }
.btn-success:hover { background: #0d8642; color: #fff; }
.btn-danger { background: var(--c-danger); color: #fff; }
.btn-danger:hover { background: #c02623; color: #fff; }
.btn-ghost {
  background: transparent; border-color: var(--c-border); color: var(--c-text-sub);
}
.btn-ghost:hover { border-color: var(--c-primary); color: var(--c-primary); background: var(--c-primary-soft); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 12px 30px; font-size: 15px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--c-card); border: 1px solid var(--c-border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card + .card { margin-top: 18px; }
.card-head {
  padding: 15px 20px; border-bottom: 1px solid var(--c-border-soft);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card-head h2, .card-head h3 { font-size: 15px; font-weight: 600; }
.card-body { padding: 20px; }
.card-body.p0 { padding: 0; }

/* ---------------- 提示条 ---------------- */
.alert {
  padding: 11px 16px; border-radius: var(--radius-sm);
  margin-bottom: 16px; font-size: 14px; border: 1px solid transparent;
}
.alert-success { background: var(--c-success-soft); color: #0b6b36; border-color: #b9e6cc; }
.alert-danger  { background: var(--c-danger-soft);  color: #9e1f1d; border-color: #f5c3c2; }
.alert-warning { background: var(--c-warning-soft); color: #8a5a06; border-color: #f2ddaf; }
.alert-info    { background: var(--c-primary-soft); color: #1b4ba8; border-color: #c2d7fb; }

/* ---------------- 表单 ---------------- */
.form-row { margin-bottom: 17px; }
.form-row label {
  display: block; margin-bottom: 6px;
  font-size: 13.5px; font-weight: 500; color: var(--c-text-sub);
}
.form-row .req { color: var(--c-danger); margin-left: 3px; }
.form-row .hint { font-size: 12px; color: var(--c-text-mute); margin-top: 5px; }
/* 「示例」小按钮：贴在字段标签右侧 */
.form-row label .fill-one {
  float: right; margin-top: -1px; padding: 1px 8px;
  font-size: 11.5px; font-weight: 400; line-height: 18px;
  color: var(--c-primary); background: var(--c-primary-weak, #eef4ff);
  border: 1px solid var(--c-primary-weak-border, #d6e3ff); border-radius: 4px;
  cursor: pointer; font-family: inherit;
}
.form-row label .fill-one:hover { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }

/* 验证码：输入框 + 图片并排（前台登录/注册、后台登录共用） */
.captcha-row { display: flex; align-items: center; gap: 10px; }
.captcha-row .input { flex: 1 1 auto; min-width: 0; }
.captcha-row img {
  flex: 0 0 auto; height: 40px; width: 108px; object-fit: cover;
  border: 1px solid var(--c-border); border-radius: var(--radius-sm);
  background: #fff; cursor: pointer;
}

.input, .select, .textarea {
  width: 100%; padding: 9px 13px;
  border: 1px solid var(--c-border); border-radius: var(--radius-sm);
  font-size: 14px; font-family: inherit; color: var(--c-text);
  background: var(--c-card); transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, .12);
}
.textarea { resize: vertical; min-height: 78px; line-height: 1.6; }
.select { cursor: pointer; }

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 18px; }
.form-grid.col3 { grid-template-columns: repeat(3, 1fr); }
.form-grid .span2 { grid-column: span 2; }

/* ---------------- 表格 ---------------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td {
  padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--c-border-soft);
  vertical-align: middle;
}
.table th {
  background: #fafbfd; font-weight: 600; font-size: 13px;
  color: var(--c-text-sub); white-space: nowrap;
}
.table tbody tr:hover { background: #fafbfd; }
.table tbody tr:last-child td { border-bottom: none; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { white-space: nowrap; }
.table .actions .btn { margin-right: 5px; }
.table-wrap { overflow-x: auto; }

.empty {
  padding: 55px 20px; text-align: center; color: var(--c-text-mute);
}
.empty .ico { font-size: 40px; opacity: .35; display: block; margin-bottom: 10px; }

/* ---------------- 徽标 ---------------- */
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 20px;
  font-size: 12px; font-weight: 500; line-height: 1.7;
}
.badge-on   { background: var(--c-success-soft); color: #0b6b36; }
.badge-off  { background: #f0f1f4; color: #6b7280; }
.badge-blue { background: var(--c-primary-soft); color: var(--c-primary); }
.badge-warn { background: var(--c-warning-soft); color: #8a5a06; }

/* ---------------- 统计卡 ----------------
   列数一律用 class 控制（.col5 等），别写在 style="" 里 ——
   内联样式特异性高于媒体查询，会让下面所有断点失效。 */
.stat-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px;
}
.stat-grid.col5 { grid-template-columns: repeat(5, 1fr); }
.stat-grid.col3 { grid-template-columns: repeat(3, 1fr); }
.stat-grid.col2 { grid-template-columns: repeat(2, 1fr); }
.stat {
  background: var(--c-card); border: 1px solid var(--c-border);
  border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm);
  position: relative;
}
.stat .k { font-size: 13px; color: var(--c-text-sub); margin-bottom: 6px; }
.stat .v { font-size: 27px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat .v.c-primary { color: var(--c-primary); }
.stat .v.c-success { color: var(--c-success); }
.stat .v.c-warning { color: var(--c-warning); }
.stat .v.c-danger  { color: var(--c-danger); }
.stat .stat-body { position: relative; z-index: 1; }
.stat .ico {
  position: absolute; top: 18px; right: 20px;
  width: 42px; height: 42px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 21px;
}
.stat .ico.i-primary { background: var(--c-primary-soft); color: var(--c-primary); }
.stat .ico.i-success { background: var(--c-success-soft); color: var(--c-success); }
.stat .ico.i-warning { background: var(--c-warning-soft); color: var(--c-warning); }
.stat .ico.i-danger  { background: var(--c-danger-soft);  color: var(--c-danger); }
.stat .foot {
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--c-border-soft);
  font-size: 12.5px; color: var(--c-text-mute);
}

/* 前台选项卡 */
.tabs {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  padding: 5px; background: var(--c-card);
  border: 1px solid var(--c-border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); width: fit-content; max-width: 100%;
}
.tabs > a {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 17px; border-radius: var(--radius-sm);
  font-size: 14px; color: var(--c-text); text-decoration: none;
  transition: background .15s, color .15s; white-space: nowrap;
}
.tabs > a i { font-size: 16px; }
.tabs > a:hover { background: var(--c-border-soft); color: var(--c-text); }
.tabs > a.on { background: var(--c-primary); color: #fff; font-weight: 500; }
.tabs > a.on:hover { background: var(--c-primary); color: #fff; }

/* ---------------- 模板卡片（前台） ---------------- */
.tpl-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 16px;
}
.tpl-card {
  background: var(--c-card); border: 1px solid var(--c-border);
  border-radius: var(--radius); overflow: hidden; transition: all .18s;
  display: flex; flex-direction: column;
}
.tpl-card:hover {
  border-color: var(--c-primary); box-shadow: var(--shadow);
  transform: translateY(-3px);
}
.tpl-thumb {
  position: relative; height: 172px; background: #f7f8fb;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  border-bottom: 1px solid var(--c-border-soft);
}
.tpl-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.tpl-thumb .ph { font-size: 34px; color: #ccd3df; }
.tpl-meta { padding: 12px 14px; flex: 1; display: flex; flex-direction: column; }
.tpl-meta .n { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.tpl-meta .s { font-size: 12px; color: var(--c-text-mute); margin-bottom: 10px; flex: 1; }
.tpl-meta .b { display: flex; gap: 6px; }
.tpl-meta .b .btn { flex: 1; }

.cat-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.cat-bar a {
  padding: 6px 15px; border-radius: 20px; background: var(--c-card);
  border: 1px solid var(--c-border); color: var(--c-text-sub); font-size: 13.5px;
}
.cat-bar a:hover { border-color: var(--c-primary); color: var(--c-primary); }
.cat-bar a.on { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
/* 省份 / 城市两级筛选：标签 + 第二行（城市）紧凑样式 */
.cat-bar .cat-lbl {
  display: inline-flex; align-items: center; padding-right: 2px;
  color: var(--c-text-mute); font-size: 12.5px; font-weight: 600; letter-spacing: .5px;
}
.cat-bar.sub { margin-top: -8px; }
.cat-bar.sub a { padding: 5px 13px; font-size: 12.5px; }

/* ---------------- 认证页 ---------------- */
.auth-page {
  min-height: calc(100vh - 62px - 60px);
  display: flex; align-items: center; justify-content: center; padding: 40px 20px;
}
.auth-box {
  width: 100%; max-width: 400px; background: var(--c-card);
  border: 1px solid var(--c-border); border-radius: 14px;
  padding: 34px 32px; box-shadow: var(--shadow);
}
.auth-box h1 { font-size: 21px; margin-bottom: 6px; text-align: center; }
.auth-box .sub { text-align: center; color: var(--c-text-mute); font-size: 13.5px; margin-bottom: 26px; }
.auth-box .foot { text-align: center; margin-top: 20px; font-size: 13.5px; color: var(--c-text-sub); }

/* ---------------- 后台布局 ---------------- */
.admin-body { background: #f0f2f7; }
.admin-shell { display: flex; min-height: 100vh; }
.admin-side {
  width: 218px; flex: 0 0 218px; background: #1d2433; color: #c7cedb;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.admin-brand {
  display: flex; align-items: center; gap: 10px; padding: 18px 20px;
  font-size: 15.5px; font-weight: 700; color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.admin-menu { flex: 1; padding: 12px 10px; overflow-y: auto; }
.admin-menu a {
  display: flex; align-items: center; gap: 11px; padding: 10px 14px;
  border-radius: var(--radius-sm); color: #aab3c4; font-size: 14px; margin-bottom: 3px;
  transition: all .14s;
}
.admin-menu a i { font-style: normal; width: 17px; text-align: center; opacity: .8; }
.admin-menu a:hover { background: rgba(255,255,255,.07); color: #fff; }
.admin-menu a.on { background: var(--c-primary); color: #fff; }
.admin-side-foot { padding: 15px 20px; border-top: 1px solid rgba(255,255,255,.08); }
.admin-side-foot a { color: #8c96a8; font-size: 13px; }
.admin-side-foot a:hover { color: #fff; }

.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-top {
  height: 60px; background: var(--c-card); border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; position: sticky; top: 0; z-index: 20;
}
.admin-top h1 { font-size: 17px; font-weight: 600; }
.admin-top-right { display: flex; align-items: center; gap: 12px; }
.admin-content { padding: 22px 24px 45px; flex: 1; }

/* ---------------- 筛选栏 ---------------- */
.filter-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px 20px; border-bottom: 1px solid var(--c-border-soft);
  background: #fafbfd;
}
.filter-bar .input, .filter-bar .select { width: auto; min-width: 150px; }

/* ---------------- 分页 ---------------- */
.pager {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 18px; border-top: 1px solid var(--c-border-soft);
}
.pager a, .pager span {
  min-width: 34px; height: 34px; padding: 0 11px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--c-border); border-radius: var(--radius-sm);
  color: var(--c-text-sub); font-size: 13.5px; background: var(--c-card);
}
.pager a:hover { border-color: var(--c-primary); color: var(--c-primary); }
.pager .cur { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.pager .off { opacity: .45; pointer-events: none; }
.pager .info { border: none; background: none; color: var(--c-text-mute); min-width: auto; }

/* ---------------- 模板字段编辑 ---------------- */
.field-list { display: flex; flex-direction: column; gap: 10px; }
.field-item {
  display: grid; grid-template-columns: 96px 1fr 130px 100px 100px 78px;
  gap: 10px; align-items: center;
  padding: 12px 14px; border: 1px solid var(--c-border);
  border-radius: var(--radius-sm); background: var(--c-card);
}
.field-item .input[type="number"] { text-align: center; }
.field-item input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--c-primary); cursor: pointer; }
.field-item .fk {
  font-family: ui-monospace, Consolas, monospace; font-size: 12.5px;
  color: var(--c-primary); background: var(--c-primary-soft);
  padding: 3px 8px; border-radius: 4px; text-align: center;
}
.field-item .input, .field-item .select { padding: 6px 10px; font-size: 13px; }
/* 示例文本整行输入框 */
.field-item .span-full { grid-column: 1 / -1; }

/* ---------------- 文档预览 ---------------- */
.doc-preview {
  background: #e9ebf0; padding: 24px; border-radius: var(--radius);
  display: flex; justify-content: center; overflow-x: auto;
}
.doc-preview iframe {
  width: 100%; min-height: 1100px; border: none; background: #fff;
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
}

/* ---------------- 工具类 ---------------- */
.mt0 { margin-top: 0; } .mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; }
.mt24 { margin-top: 24px; } .mb0 { margin-bottom: 0; } .mb8 { margin-bottom: 8px; }
.mb16 { margin-bottom: 16px; } .mb24 { margin-bottom: 24px; }
.flex { display: flex; } .flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center { display: flex; align-items: center; } .gap8 { gap: 8px; } .gap12 { gap: 12px; }
.text-sub { color: var(--c-text-sub); } .text-mute { color: var(--c-text-mute); }
.text-sm { font-size: 13px; } .text-xs { font-size: 12px; } .text-r { text-align: right; }
.text-c { text-align: center; } .fw6 { font-weight: 600; } .nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, Consolas, monospace; }

/* ---------------- 密码强度计 ---------------- */
.pw-meter { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.pw-bars { display: flex; gap: 4px; flex: 0 0 auto; }
.pw-bars i {
  display: block; width: 34px; height: 5px; border-radius: 3px;
  background: var(--c-border); transition: background .18s;
}
.pw-bars i.on.lv1 { background: #e5484d; }
.pw-bars i.on.lv2 { background: #f5a524; }
.pw-bars i.on.lv3 { background: #3b82f6; }
.pw-bars i.on.lv4 { background: #16a34a; }
.pw-text { font-size: 12.5px; font-weight: 600; }
.pw-text.lv0 { color: var(--c-text-mute); }
.pw-text.lv1 { color: #e5484d; }
.pw-text.lv2 { color: #f5a524; }
.pw-text.lv3 { color: #3b82f6; }
.pw-text.lv4 { color: #16a34a; }
.hint-bad { color: #e5484d; }

/* ---------------- 批量操作条 ---------------- */
.batch-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 18px; border-bottom: 1px solid var(--c-border);
  background: var(--c-bg); font-size: 13px; transition: background .15s;
}
.batch-bar.has-sel { background: var(--c-primary-soft); }
.batch-bar .spacer { margin-left: auto; }
.batch-bar .chk-all {
  display: inline-flex; align-items: center; gap: 7px;
  cursor: pointer; font-weight: 500; color: var(--c-text-sub); white-space: nowrap;
}
.batch-bar input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: var(--c-primary); cursor: pointer;
}
.table td > input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: var(--c-primary); cursor: pointer;
}

/* ---------------- 实时预览抽屉 ---------------- */
.pv-mask {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(20, 30, 50, .42);
  opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s;
}
.pv-mask.show { opacity: 1; visibility: visible; }

.pv-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 201;
  width: min(880px, 94vw);
  background: #fff; box-shadow: -8px 0 40px rgba(20, 30, 50, .18);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .24s ease;
}
.pv-drawer.open { transform: translateX(0); }
body.pv-open { overflow: hidden; }

/* 头部 */
.pv-drawer .pv-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px; border-bottom: 1px solid var(--c-border); flex: 0 0 auto;
}
.pv-drawer .pv-title { display: flex; flex-direction: column; line-height: 1.3; }
.pv-drawer .pv-title b { font-size: 15px; }
.pv-drawer .pv-sub { font-size: 12px; color: var(--c-text-sub); }
.pv-drawer .pv-tools { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.pv-drawer .pv-tool {
  width: 34px; height: 34px; border: none; background: none; border-radius: 8px;
  cursor: pointer; font-size: 17px; color: var(--c-text-sub);
  display: inline-flex; align-items: center; justify-content: center;
}
.pv-drawer .pv-tool:hover { background: var(--c-border-soft); color: var(--c-primary); }
.pv-drawer .pv-tool.off { color: #c4ccd8; }
.pv-drawer .pv-zoom {
  min-width: 46px; text-align: center; font-size: 12.5px; color: var(--c-text-sub);
  font-variant-numeric: tabular-nums;
}

/* 图例条 */
.pv-drawer .pv-legend {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 8px 16px; border-bottom: 1px solid var(--c-border);
  background: #f8fafc; font-size: 12.5px; color: var(--c-text-sub); flex: 0 0 auto;
}
.pv-drawer .pv-lg-item { display: inline-flex; align-items: center; gap: 6px; }
.pv-drawer .pv-lg-item b { color: var(--c-text); }
.pv-drawer .pv-dot {
  width: 9px; height: 9px; border-radius: 50%; display: inline-block;
}
.pv-drawer .pv-dot.on { background: #13deb9; }
.pv-drawer .pv-dot.off { background: #d9dee6; }
.pv-drawer .pv-lg-hint { margin-left: auto; color: #9aa6b8; }

/* 预览区（可滚动） */
.pv-drawer .pv-body {
  flex: 1; overflow: auto; background: #e9e9e9; padding: 20px;
  position: relative;
}
.pv-drawer .pv-stage { margin: 0 auto; width: fit-content; }
.pv-drawer .pv-stage > .sheet,
.pv-drawer .pv-stage > *:not(.pv-loading) {
  background: #fff; box-shadow: 0 2px 14px rgba(0, 0, 0, .1);
}
.pv-drawer .pv-loading {
  display: flex; align-items: center; justify-content: center;
  height: 200px; color: #8b94a3; font-size: 14px;
}
.pv-drawer .pv-loading.pv-error { color: #d9534f; }

/* 渲染中：顶部细进度条，不清空旧内容 */
.pv-drawer.loading .pv-head::after {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--c-primary), transparent);
  animation: pv-slide 1.1s infinite;
}
.pv-drawer .pv-head { position: relative; }
@keyframes pv-slide {
  0% { transform: translateX(-100%); opacity: .4; }
  50% { opacity: 1; }
  100% { transform: translateX(100%); opacity: .4; }
}

/* 预览里字段的高亮 / 已填未填 */
.pv-drawer .pv-f {
  border-radius: 3px; cursor: pointer; transition: background .15s;
}
.pv-drawer .pv-f-off {
  background: rgba(255, 174, 31, .16);
  box-shadow: inset 0 -1px 0 rgba(255, 174, 31, .5);
}
.pv-drawer .pv-f-on {
  background: rgba(19, 222, 185, .13);
}
.pv-drawer .pv-f:hover { background: rgba(93, 135, 255, .2); }
.pv-drawer .pv-f.pv-hit {
  background: rgba(93, 135, 255, .3);
  outline: 2px solid var(--c-primary); outline-offset: 1px;
}

/* 底部操作条 */
.pv-drawer .pv-foot {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 16px; border-top: 1px solid var(--c-border); flex: 0 0 auto;
  background: #fff;
}
.pv-drawer .pv-foot .btn:last-child { margin-left: auto; }

/* 输入框被动跳转时闪一下 */
.f-flash { animation: f-flash .6s ease 2; }
@keyframes f-flash {
  0%, 100% { background: #fff; }
  50% { background: #eef4ff; box-shadow: 0 0 0 3px rgba(93, 135, 255, .18); }
}

@media (max-width: 560px) {
  .pv-drawer { width: 100vw; }
  .pv-drawer .pv-lg-hint { display: none; }
  .batch-bar { flex-wrap: wrap; }
}

/* ---------------- 响应式（H5 适配） ----------------
   断点：1180（宽屏收窄） / 900（平板） / 860（侧边抽屉） / 620（手机） / 480（窄屏） */
@media (max-width: 1180px) {
  .stat-grid.col5 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .stat-grid, .stat-grid.col5, .stat-grid.col3 { grid-template-columns: repeat(2, 1fr); }
  .form-grid, .form-grid.col3 { grid-template-columns: 1fr; }
  .form-grid .span2 { grid-column: span 1; }
  .field-item { grid-template-columns: 1fr 1fr; }
  .uc-two { grid-template-columns: 1fr; }
  .admin-side { position: fixed; left: -218px; z-index: 100; transition: left .2s; }
  .admin-side.open { left: 0; }
}
/* ---------------- 小屏侧边导航 ----------------
   .site-nav 与小屏是同一份 DOM —— ≤980px 时靠 CSS 把它变成左侧抽屉，
   不另写一套菜单（写过两版，两边迟早不同步）。
   980 = 桌面菜单「9 项全部放得下」的临界（1180 以下菜单会折行）；
   后台侧栏断点仍是 860（admin.css / app.js 的 SIDE_BP），互不影响。 */
.nav-burger { display: none; }
.side-close { display: none; }
.site-mask  { display: none; }
/* 桌面顶栏不显示图标（余额那个除外，它本来就有） */
.site-nav > a > i.nav-ic { display: none; }
/* 桌面菜单永不折行：放不下时由上面的断点收进抽屉，不允许「模板/库」竖排 */
.site-nav > a { white-space: nowrap; }

@media (max-width: 860px) {
  .pv-drawer { width: 100vw; }
}

@media (max-width: 980px) {
  /* 汉堡按钮 */
  .nav-burger {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; flex: 0 0 38px; padding: 0;
    border: 1px solid var(--c-border); border-radius: var(--radius-sm);
    background: #fff; color: var(--c-text-sub); cursor: pointer; font-family: inherit;
    transition: all .15s;
  }
  .nav-burger i { font-size: 22px; }
  .nav-burger:hover { border-color: var(--c-primary); color: var(--c-primary); background: var(--c-primary-soft); }

  /* 抽屉本体：脱离文档流，顶栏只剩 logo + 汉堡 */
  .site-nav {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 120;
    width: 272px; max-width: 84vw;
    flex-direction: column; align-items: stretch; gap: 2px;
    padding: 14px 12px 26px; background: var(--c-card);
    border-right: 1px solid var(--c-border); box-shadow: var(--shadow-lg);
    transform: translateX(-100%); transition: transform .22s ease;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
  }
  .site-nav.open { transform: none; }

  .site-nav > a, .site-nav > button {
    display: flex; align-items: center; gap: 11px; width: 100%;
    padding: 11px 13px; border-radius: var(--radius-sm); font-size: 14.5px;
    color: var(--c-text); font-weight: 500;
  }
  .site-nav > a > i.nav-ic { display: inline-block; font-size: 19px; }
  .site-nav > a:hover { background: var(--c-border-soft); }
  .site-nav > a.on { background: var(--c-primary-soft); color: var(--c-primary); }
  /* 抽屉里要把原本为省空间隐藏的「当前项 / 用户名」都放出来 */
  .site-nav > a.on, .site-nav .nav-user { display: flex; }
  .site-nav .nav-user { margin-left: 0; font-size: 14.5px; }
  .site-nav .nav-balance { justify-content: flex-start; background: var(--c-primary-soft); }
  .site-nav .nav-balance > i { font-size: 19px; }
  .site-nav .nav-balance b { margin-left: auto; font-size: 14.5px; }
  .site-nav .btn-sm { padding: 10px 13px; font-size: 14.5px; width: 100%; }

  /* 抽屉里的多级菜单：子菜单改为手风琴（不浮层），一级与普通菜单项同款 */
  .site-nav > .nav-drop { display: block; }
  .site-nav .nav-drop-btn {
    display: flex; align-items: center; gap: 11px; width: 100%;
    padding: 11px 13px; border-radius: var(--radius-sm);
    font-size: 14.5px; color: var(--c-text); font-weight: 500;
  }
  .site-nav .nav-drop-btn > i.nav-ic { display: inline-block; font-size: 19px; }
  .site-nav .nav-drop-btn:hover { background: var(--c-border-soft); }
  .site-nav .nav-drop-btn.on { background: var(--c-primary-soft); color: var(--c-primary); }
  .site-nav .nav-caret { margin-left: auto; }
  .site-nav .nav-drop-menu {
    position: static; display: none; min-width: 0;
    margin: 2px 0 4px; padding: 2px 0 2px 32px;
    background: none; border: 0; box-shadow: none;
  }
  .site-nav .nav-drop.open .nav-drop-menu { display: block; }
  .site-nav .nav-drop-menu > a { padding: 9px 12px; font-size: 14px; }
  .site-nav .nav-drop-menu > a > i { font-size: 17px; }

  /* 必须写成 .site-nav > button.side-close —— 上面那条 `> button { width:100% }`
     特异性更高，只写 .side-close 会被铺满整行 */
  .site-nav > button.side-close {
    display: flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; flex: 0 0 34px; margin: 0 0 10px auto; padding: 0;
    border: 1px solid var(--c-border); border-radius: 50%;
    background: #fff; color: var(--c-text-sub); cursor: pointer; font-family: inherit;
    transition: all .15s;
  }
  .site-nav > button.side-close i { font-size: 18px; }
  .site-nav > button.side-close:hover {
    border-color: var(--c-primary); color: var(--c-primary); background: var(--c-primary-soft);
  }

  .site-mask.show {
    display: block; position: fixed; inset: 0; z-index: 110;
    background: rgba(16, 22, 38, .45);
  }
}
/* 手机：触控目标放大到 40px+，卡片留白收紧，避免挤成一团 */
@media (max-width: 620px) {
  .stat { padding: 14px 15px; }
  .stat .v { font-size: 23px; }
  .uc-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .uc-hero-l { min-width: 0; }
  .key-value code { flex-basis: 100%; }
  .uc-flow-l { min-width: 0; }
  .uc-flow-rm { white-space: normal; }
  .cols-7-5 { grid-template-columns: 1fr; }

  /* 操作日志：筛选区堆叠、行紧凑 */
  .lg-head { padding: 12px 14px 11px; }
  .lg-tabs { gap: 6px; }
  .lg-tab { min-height: 34px; padding: 7px 13px; }
  .lg-search { width: 100%; }
  .lg-search .input { flex: 1 1 auto; width: auto; min-width: 0; }
  .lg-list, .uc-log-list { padding-left: 14px; padding-right: 14px; }
  .lg-item { gap: 10px; }
  .lg-ico { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 9px; }
  .lg-ico i { font-size: 15px; }

  /* 触控目标：原来 .btn-sm 只有 31px，手指容易点偏 */
  .btn { min-height: 40px; padding: 10px 16px; }
  .btn-sm { min-height: 36px; padding: 8px 14px; font-size: 13.5px; }
  .btn-lg { min-height: 46px; }
  .icon-btn { width: 38px; height: 38px; }
  .chip { min-height: 36px; padding: 8px 16px; }
  .api-tab { min-height: 36px; padding: 7px 15px; }
  .tabs > a { padding: 10px 14px; }
  /* 字段标签右边的「示例」小按钮，默认 21px 太难点 */
  .form-row label .fill-one {
    float: none; margin-left: 6px; padding: 4px 10px;
    font-size: 12px; line-height: 20px;
  }

  /* 一排按钮放不下就换行，不要横向溢出 */
  .flex, .flex-center, .flex-between { flex-wrap: wrap; }
  .act { flex-wrap: wrap; }

  /* 表格：字号与内边距按手机收紧，配合 .table-wrap 横向滚动 */
  .table { font-size: 13px; }
  .table th, .table td { padding: 9px 10px; }

  /* 长串（文书编号 / 密钥 / curl）允许断行，不撑破布局 */
  body { overflow-wrap: break-word; }
  code, pre { overflow-wrap: anywhere; }
}
@media (max-width: 480px) {
  .stat-grid, .stat-grid.col5, .stat-grid.col3 { grid-template-columns: repeat(2, 1fr); }
  .stat .v { font-size: 21px; }
  .uc-grid { grid-template-columns: 1fr; }
  .uc-hero { padding: 16px; gap: 14px; }
  .uc-hero-r { gap: 16px 22px; }
  .modal-box { margin-top: 6vh; }
  .card-body { padding: 16px; }
  .card-head { padding: 13px 16px; }
}
@media (max-width: 560px) {
  .pv-drawer .pv-legend { gap: 10px; }
  .pv-drawer .pv-tools { gap: 0; }
  .pv-drawer .pv-zoom { min-width: 40px; }
}

/* ============================================================
   支付 / 充值 / 订单 相关样式
   ============================================================ */

/* ---- 顶栏余额入口 ---- */
.site-nav .nav-balance {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px; border-radius: 999px;
  background: var(--c-primary-soft); color: var(--c-primary);
  font-size: 13px; font-weight: 500;
}
.site-nav .nav-balance b { font-weight: 700; font-variant-numeric: tabular-nums; }
.site-nav .nav-balance:hover { background: #dbe7ff; }

/* ---- 模板卡价格角标 ---- */
.tpl-price {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  padding: 3px 10px; border-radius: 999px;
  background: rgba(214, 137, 16, .94); color: #fff;
  font-size: 12.5px; font-weight: 700; letter-spacing: .2px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .14);
  font-variant-numeric: tabular-nums;
}
.tpl-price.free { background: rgba(18, 161, 80, .94); }

/* ---- 充值：快捷金额 ---- */
.rc-presets {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.rc-chip {
  padding: 14px 8px; cursor: pointer;
  background: #fff; border: 1.5px solid var(--c-border);
  border-radius: var(--radius); font-family: inherit;
  transition: all .15s;
}
.rc-chip b { display: block; font-size: 16px; color: var(--c-text); font-variant-numeric: tabular-nums; }
.rc-chip:hover { border-color: var(--c-primary); background: #f7faff; }
.rc-chip.on {
  border-color: var(--c-primary); background: var(--c-primary-soft);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, .1);
}
.rc-chip.on b { color: var(--c-primary); }
/* 快捷金额上的「赠」标签 */
.rc-chip { position: relative; }
.rc-chip .rc-gift {
  position: absolute; top: -9px; right: 8px;
  padding: 1px 7px; border-radius: 999px;
  background: linear-gradient(135deg, #ff9a3d, #ff6b35);
  color: #fff; font-size: 11px; font-weight: 700; line-height: 1.6;
  box-shadow: 0 2px 6px rgba(255, 107, 53, .35);
}
.rc-chip .rc-sub {
  display: block; margin-top: 3px; font-size: 11.5px; color: var(--c-text-mute);
  font-variant-numeric: tabular-nums;
}
.rc-chip.has-gift { border-color: #ffd9c2; }
.rc-chip.has-gift:hover { border-color: var(--c-warning); background: #fffaf6; }
.rc-chip.has-gift.on { border-color: var(--c-warning); background: #fff6ef; box-shadow: 0 0 0 3px rgba(255, 154, 61, .14); }
.rc-chip.has-gift.on b { color: #d9500a; }

/* ---- 充值满赠：活动横幅 ---- */
.bonus-banner {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; border-radius: var(--radius);
  background: linear-gradient(135deg, #fff6ef, #fff0f6);
  border: 1px solid #ffdcc7;
}
.bonus-banner > i { font-size: 22px; color: #ff6b35; flex: 0 0 auto; margin-top: 1px; }
.bonus-banner .bn-t { font-weight: 700; color: #b23c00; margin-bottom: 8px; }
.bonus-banner .bn-tiers { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---- 满赠阶梯标签（前后台通用） ---- */
.bonus-tiers { display: flex; flex-wrap: wrap; gap: 8px; }
.bonus-tier {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 4px 12px; border-radius: 999px; font-size: 13px;
  background: #fff6ef; border: 1px solid #ffdcc7; color: #b23c00;
  font-variant-numeric: tabular-nums;
}
.bonus-tier b { color: #e14f00; }
.bonus-tiers.on-dark .bonus-tier { background: #fff; border-color: #ffdcc7; }

/* 到账提示里的赠额小字 */
.bonus-hint { font-size: 12.5px; color: #d9500a; }

/* ---- 充值：支付方式选择 ---- */
.pay-channels { display: flex; gap: 10px; flex-wrap: wrap; }
.pay-channel { cursor: pointer; }
.pay-channel input { position: absolute; opacity: 0; width: 0; height: 0; }
.pay-channel .pc-box {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 18px; border: 1.5px solid var(--c-border);
  border-radius: var(--radius); font-size: 14px; background: #fff;
  transition: all .15s;
}
.pay-channel .pc-box i { font-size: 19px; }
.pay-channel input:checked + .pc-box {
  border-color: var(--c-primary); background: var(--c-primary-soft);
  color: var(--c-primary); font-weight: 600;
}
.pay-channel:hover .pc-box { border-color: var(--c-primary); }

/* ---- 支付结果页 ---- */
.pay-result-ico {
  width: 76px; height: 76px; margin: 0 auto;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
.pay-result-ico i { font-size: 42px; }
.pay-result-ico.ok   { background: var(--c-success-soft); color: var(--c-success); }
.pay-result-ico.warn { background: var(--c-warning-soft); color: var(--c-warning); }
.pay-result-ico.bad  { background: var(--c-danger-soft);  color: var(--c-danger); }

.pay-summary {
  margin-top: 24px; text-align: left;
  border: 1px solid var(--c-border-soft); border-radius: var(--radius);
  overflow: hidden;
}
.pay-summary > div {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 11px 16px; font-size: 13.5px;
  border-bottom: 1px solid var(--c-border-soft);
}
.pay-summary > div:last-child { border-bottom: 0; }
.pay-summary > div > span { color: var(--c-text-mute); flex: 0 0 auto; }
.pay-summary > div > b { text-align: right; overflow-wrap: anywhere; }

/* ---- 金额强调 ---- */
.c-primary { color: var(--c-primary); }
.c-success { color: var(--c-success); }
.c-warning { color: var(--c-warning); }
.c-danger  { color: var(--c-danger); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.num  { text-align: right; font-variant-numeric: tabular-nums; }

/* ---- 提醒条：成功/普通变体 ---- */
.notice-bar.tone-success {
  background: var(--c-success-soft); color: #0b6b36; border-color: #b9e6cc;
}

/* ============================================================
   用户中心 / 对接中心 / 接口文档
   （uc-* / key-* / api-* 系列；与上方卡片系统共用同一套变量）
   ============================================================ */
.uc-wrap { padding: 22px 0 40px; }
.uc-card { margin-bottom: 0; }
.uc-page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 18px; flex-wrap: wrap;
}
.uc-page-head h1 { font-size: 22px; font-weight: 700; letter-spacing: -.2px; }
.uc-page-desc { color: var(--c-text-sub); font-size: 13.5px; margin-top: 4px; max-width: 720px; }
.uc-page-desc b { color: var(--c-primary); }
.card-head .sub { font-size: 12.5px; color: var(--c-text-mute); margin-top: 3px; }

/* ---- 概览头部 ---- */
.uc-hero {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding: 22px 24px; flex-wrap: wrap; margin-bottom: 18px;
}
.uc-hero-l { display: flex; align-items: center; gap: 16px; min-width: 260px; }
.uc-avatar {
  width: 54px; height: 54px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: var(--c-primary-soft); color: var(--c-primary);
}
.uc-avatar i { font-size: 26px; }
.uc-name { font-size: 19px; font-weight: 700; }
.uc-sub { font-size: 13px; color: var(--c-text-mute); display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.uc-dot { opacity: .5; }
.uc-hero-r { display: flex; gap: 30px; flex-wrap: wrap; }
.uc-stat { display: flex; flex-direction: column; gap: 2px; }
.uc-stat .k { font-size: 12.5px; color: var(--c-text-mute); }
.uc-stat .v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.uc-stat .v.money { color: var(--c-primary); }

/* ---- 功能入口九宫格 ---- */
.uc-grid {
  display: grid; gap: 14px; margin-bottom: 18px;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}
.uc-tile {
  display: block; padding: 18px; background: var(--c-card);
  border: 1px solid var(--c-border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); transition: all .15s; color: var(--c-text);
}
.uc-tile:hover {
  transform: translateY(-2px); box-shadow: var(--shadow);
  border-color: var(--c-primary); color: var(--c-text);
}
.uc-tile-ico {
  width: 40px; height: 40px; border-radius: 9px; margin-bottom: 11px;
  display: flex; align-items: center; justify-content: center;
  background: var(--c-primary-soft); color: var(--c-primary);
}
.uc-tile-ico i { font-size: 21px; }
.uc-tile-t { font-size: 14.5px; font-weight: 600; margin-bottom: 3px; }
.uc-tile-d { font-size: 12.5px; color: var(--c-text-mute); line-height: 1.55; }

/* ---- 余额流水列表 ---- */
.uc-flow-list { padding: 4px 20px 16px; }
.uc-flow {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 12px 0; border-bottom: 1px dashed var(--c-border-soft);
}
.uc-flow:last-child { border-bottom: 0; }
.uc-flow-l { display: flex; align-items: center; gap: 10px; min-width: 0; }
.uc-flow-rm { font-size: 13.5px; color: var(--c-text-sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uc-flow-r { display: flex; align-items: center; gap: 14px; flex: 0 0 auto; }
.uc-flow-time { font-size: 12.5px; color: var(--c-text-mute); font-variant-numeric: tabular-nums; }

/* ---- 统计小卡（邀请中心 / 对接中心复用） ---- */
.uc-invite-stat, .uc-mini-stat {
  display: grid; gap: 14px; margin-bottom: 18px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.uc-invite-stat .card, .uc-mini-stat .card { margin-top: 0; }
.card.is-stat { padding: 15px 18px; display: flex; flex-direction: column; gap: 1px; }
.card.is-stat .k { font-size: 12.5px; color: var(--c-text-mute); }
.card.is-stat .v { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.card.is-stat .v.money { color: var(--c-primary); }
.card.is-stat .u { font-size: 12px; color: var(--c-text-mute); font-weight: 400; }

/* ---- 密钥 / 地址展示盒 ---- */
.key-box {
  border: 1px solid var(--c-border); border-radius: var(--radius);
  background: #fbfcfe; padding: 13px 15px; margin-bottom: 12px;
}
.key-box:last-of-type { margin-bottom: 0; }
.key-label {
  font-size: 11.5px; font-weight: 600; letter-spacing: .5px;
  color: var(--c-text-mute); text-transform: uppercase; margin-bottom: 6px;
}
.key-value { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.key-value code {
  flex: 1 1 320px; min-width: 0; padding: 7px 11px;
  background: #fff; border: 1px solid var(--c-border-soft); border-radius: var(--radius-sm);
  font-family: ui-monospace, Consolas, monospace; font-size: 13px;
  color: var(--c-text); overflow-wrap: anywhere;
}

/* ---- 提示气泡 ---- */
.callout {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 15px; margin-top: 14px; border-radius: var(--radius-sm);
  background: #f4f7fd; border: 1px solid #dde5f5;
  font-size: 13px; color: var(--c-text-sub); line-height: 1.7;
}
.callout > i { font-size: 17px; color: var(--c-primary); flex: 0 0 auto; margin-top: 1px; }
.callout code {
  padding: 1px 5px; background: #fff; border: 1px solid var(--c-border-soft);
  border-radius: 4px; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px;
}
.callout-ok { background: var(--c-success-soft); border-color: #b9e6cc; color: #0b6b36; }
.callout-ok > i { color: var(--c-success); }
.callout b { color: var(--c-text); }
.callout-ok b { color: #0b6b36; }

/* ---- 危险操作区 ---- */
.danger-zone {
  margin-top: 20px; border: 1px solid #f3cfcd; border-radius: var(--radius);
  background: #fffbfb; overflow: hidden;
}
.danger-zone > summary {
  padding: 12px 16px; cursor: pointer; font-size: 13.5px; font-weight: 600;
  color: var(--c-danger); display: flex; align-items: center; gap: 7px; list-style: none;
}
.danger-zone > summary::-webkit-details-marker { display: none; }
.danger-zone > summary:hover { background: var(--c-danger-soft); }
.dz-form { padding: 4px 16px 16px; }
.dz-warn {
  font-size: 13px; color: #9e1f1d; line-height: 1.75; margin-bottom: 12px;
  padding: 10px 13px; background: var(--c-danger-soft); border-radius: var(--radius-sm);
  border: 1px solid #f5c3c2;
}
.dz-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.dz-row .input { flex: 1 1 220px; }

/* ---- 快速开始步骤 ---- */
.qs-steps { display: flex; flex-direction: column; gap: 18px; }
.qs-step { display: flex; gap: 13px; align-items: flex-start; }
.qs-no {
  width: 25px; height: 25px; border-radius: 50%; flex: 0 0 auto;
  background: var(--c-primary); color: #fff; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; margin-top: 2px;
}
.qs-t { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.qs-step > div { min-width: 0; flex: 1 1 auto; }

/* ---- 代码块 ---- */
.code-block {
  margin: 0; padding: 13px 15px; background: #1b2030; color: #e6ebf5;
  border-radius: var(--radius-sm); overflow-x: auto;
  font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; line-height: 1.75;
}
.code-block code { font: inherit; white-space: pre; }
.uc-card .code-block code { color: inherit; }

/* ---- 用户中心两列（余额变动 / 最近动态） ---- */
.uc-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.uc-two > .card { margin-bottom: 0; }

/* ---- 操作日志（lg-*） ---- */
.lg-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; padding: 14px 20px 13px;
  border-bottom: 1px solid var(--c-border-soft);
}
.lg-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.lg-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 13px; border-radius: 18px; border: 1px solid var(--c-border);
  background: #fff; color: var(--c-text-sub); font-size: 13px;
  transition: all .15s; white-space: nowrap;
}
.lg-tab:hover { border-color: var(--c-primary); color: var(--c-primary); background: var(--c-primary-soft); }
.lg-tab.on { background: var(--c-primary); border-color: var(--c-primary); color: #fff; font-weight: 600; }
.lg-tab b { font-size: 11.5px; font-weight: 600; opacity: .72; font-variant-numeric: tabular-nums; }
.lg-tab.on b { opacity: .92; }
.lg-search { display: flex; gap: 8px; align-items: center; }
.lg-search .input { width: 210px; }

.lg-list { padding: 4px 20px 14px; }
.lg-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 0; border-bottom: 1px solid var(--c-border-soft);
}
.lg-item:last-child { border-bottom: 0; }
.lg-ico {
  width: 34px; height: 34px; border-radius: 10px; flex: 0 0 34px;
  display: flex; align-items: center; justify-content: center; margin-top: 1px;
}
.lg-ico i { font-size: 17px; }
.lg-ico.t-green { background: var(--c-success-soft); color: #0b6b36; }
.lg-ico.t-blue  { background: var(--c-primary-soft); color: var(--c-primary); }
.lg-ico.t-warn  { background: var(--c-warning-soft); color: #8a5a06; }
.lg-ico.t-info  { background: #e7f1fb; color: var(--c-info); }
.lg-ico.t-gray  { background: #f0f1f4; color: #6b7280; }
.lg-ico.t-red   { background: var(--c-danger-soft); color: var(--c-danger); }

.lg-main { flex: 1 1 auto; min-width: 0; }
.lg-line1 { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.lg-name { font-size: 14px; font-weight: 600; flex: 0 0 auto; }
.lg-text {
  font-size: 13px; color: var(--c-text-sub); min-width: 0;
  overflow-wrap: anywhere;
}
.lg-text.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
.lg-note { font-size: 12.5px; color: var(--c-text-mute); margin-top: 3px; overflow-wrap: anywhere; }
.lg-side { flex: 0 0 auto; text-align: right; }
.lg-time { font-size: 12.5px; color: var(--c-text-mute); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lg-ip { font-size: 12px; color: var(--c-text-mute); font-family: ui-monospace, Consolas, monospace; margin-top: 2px; }

/* 用户中心「最近操作动态」使用紧凑版日志行 */
.uc-log-list { padding: 4px 20px 14px; }
.uc-log-list .lg-item { padding: 10px 0; }
.uc-log-list .lg-ico { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 9px; }
.uc-log-list .lg-ico i { font-size: 15px; }
.uc-log-list .lg-name { font-size: 13.5px; }

/* ---- 接口文档 ---- */
.api-docs .uc-card { margin-bottom: 18px; }
.api-ep-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.api-method {
  padding: 3px 10px; border-radius: 5px; font-size: 11.5px; font-weight: 700;
  letter-spacing: .6px; font-family: ui-monospace, Consolas, monospace;
}
.api-m-get  { background: var(--c-primary-soft); color: var(--c-primary); }
.api-m-post { background: var(--c-success-soft); color: var(--c-success); }
.api-m-put  { background: var(--c-warning-soft); color: #8a5a06; }
.api-m-delete { background: var(--c-danger-soft); color: #9e1f1d; }
.api-path {
  font-family: ui-monospace, Consolas, monospace; font-size: 14px;
  font-weight: 600; color: var(--c-text); overflow-wrap: anywhere;
}
.api-ep-idx { font-size: 12px; color: var(--c-text-mute); font-weight: 600; }
.api-ep-title { font-size: 15px; font-weight: 600; margin-bottom: 7px; }
.api-ep-desc { font-size: 13.5px; color: var(--c-text-sub); line-height: 1.8; }
.api-ep-desc code {
  padding: 1px 5px; background: var(--c-primary-soft); border-radius: 4px;
  font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; color: var(--c-primary);
}
.api-sec-t {
  font-size: 12px; font-weight: 700; letter-spacing: .4px; color: var(--c-text-mute);
  text-transform: uppercase; margin: 18px 0 8px;
}
.api-sec-t:first-of-type { margin-top: 0; }
.api-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.api-table th, .api-table td {
  padding: 9px 12px; border-bottom: 1px solid var(--c-border-soft); text-align: left;
  vertical-align: top;
}
.api-table th { color: var(--c-text-mute); font-weight: 600; }
.api-param-table code {
  font-family: ui-monospace, Consolas, monospace; font-size: 12.5px;
  padding: 1px 5px; background: var(--c-primary-soft); border-radius: 4px; color: var(--c-primary);
}
.api-http {
  display: inline-block; padding: 2px 8px; border-radius: 5px;
  background: var(--c-border-soft); color: var(--c-text-sub);
  font-family: ui-monospace, Consolas, monospace; font-size: 12px; font-weight: 600;
}
.api-toc { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.api-toc a {
  display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: var(--radius-sm);
  font-size: 13.5px;
}
.api-toc a:hover { background: var(--c-primary-soft); }
.api-toc .n { color: var(--c-text-mute); font-size: 12px; font-variant-numeric: tabular-nums; }
.api-toc .m {
  font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 4px;
  background: var(--c-primary-soft); color: var(--c-primary);
  font-family: ui-monospace, Consolas, monospace;
}
.api-toc .m.post { background: var(--c-success-soft); color: var(--c-success); }
.api-note {
  font-size: 13px; color: var(--c-text-sub); line-height: 1.8;
  padding: 12px 15px; background: #fbfcfe; border: 1px solid var(--c-border-soft);
  border-radius: var(--radius-sm); margin-top: 12px;
}
.api-note b { color: var(--c-text); }

/* ---- 代码语言切换 ---- */
.api-tabs { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.api-tab {
  padding: 4px 12px; border-radius: 20px; border: 1px solid var(--c-border);
  background: #fff; color: var(--c-text-sub); font-size: 12.5px; cursor: pointer;
  font-family: inherit; transition: all .15s;
}
.api-tab:hover { border-color: var(--c-primary); color: var(--c-primary); }
.api-tab.on { background: var(--c-primary); border-color: var(--c-primary); color: #fff; font-weight: 600; }
.api-pane[hidden] { display: none; }

/* ---- 表格里的用户名单元 ---- */
.cell-user { display: flex; flex-direction: column; line-height: 1.4; }
.cell-user b { font-weight: 600; }
.cell-user span { font-size: 12px; }

/* ---- 圆角图标按钮 ---- */
.icon-btn {
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--c-border); background: #fff; color: var(--c-text-sub);
  cursor: pointer; font-family: inherit; transition: all .15s; padding: 0;
}
.icon-btn:hover { border-color: var(--c-primary); color: var(--c-primary); background: var(--c-primary-soft); }
.icon-btn i { font-size: 16px; }

/* ---- 金额与状态色 ---- */
.badge-info { background: #e7f1fb; color: var(--c-info); }
.badge-danger { background: var(--c-danger-soft); color: var(--c-danger); }
.badge-gray { background: #f0f1f4; color: #6b7280; }
.money { font-variant-numeric: tabular-nums; font-weight: 600; }
.money.pos { color: var(--c-success); }
.money.neg { color: var(--c-danger); }
.text-head { color: var(--c-text); font-weight: 600; }
.text-xs { font-size: 12px; }
.nowrap { white-space: nowrap; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gap8  { gap: 8px; }
.gap12 { gap: 12px; }
.mt8  { margin-top: 8px; }
.mt16 { margin-top: 16px; }
.mb16 { margin-bottom: 16px; }
.fw6  { font-weight: 600; }
.ta-r { text-align: right; }
.mla  { margin-left: auto; }
.list-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 13px 20px; border-bottom: 1px solid var(--c-border-soft);
}
.list-row:last-child { border-bottom: 0; }
.meta { font-size: 13px; color: var(--c-text-mute); }
.str  { color: var(--c-success); }

/* ---- 弹窗 ---- */
.modal { position: fixed; inset: 0; z-index: 200; }
.modal[hidden] { display: none; }
.modal-mask { position: absolute; inset: 0; background: rgba(16, 22, 38, .5); }
.modal-box {
  position: relative; z-index: 1; width: min(520px, calc(100% - 32px));
  margin: 8vh auto 0; background: var(--c-card); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--c-border-soft);
}
.modal-head h3 { font-size: 15px; font-weight: 600; }
.modal-body { padding: 18px; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 13px 18px; border-top: 1px solid var(--c-border-soft); background: #fafbfd;
}

/* ---- 金额快捷选择 ---- */
.gv-presets { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.chip {
  padding: 6px 14px; border-radius: 18px; border: 1px solid var(--c-border);
  background: #fff; color: var(--c-text-sub); font-size: 13px; cursor: pointer;
  font-family: inherit; transition: all .15s;
}
.chip:hover { border-color: var(--c-primary); color: var(--c-primary); background: var(--c-primary-soft); }

/* ============================================================
   通用变体补充（前台页面实际在用的名，上面基础块里没有的）
   ============================================================ */
.btn-light { background: #f2f4f8; color: var(--c-text); border-color: var(--c-border); }
.btn-light:hover { background: #e9ecf3; color: var(--c-text); }
.btn-warning { background: var(--c-warning); color: #fff; }
.btn-warning:hover { background: #b8740d; color: #fff; }
.alert-ok   { background: var(--c-success-soft); color: #0b6b36; border-color: #b9e6cc; }
.alert-warn { background: var(--c-warning-soft); color: #8a5a06; border-color: #f2ddaf; }
.alert-info { background: #e7f1fb; color: var(--c-info); border-color: #bcdcf3; }

/* 接口端点卡片本体（上面只定义了 -head / -title 等子元素） */
.api-ep { scroll-margin-top: 80px; }

/* 列表勾选行高亮 */
.chk-row { cursor: pointer; }

/* 充值页两栏：7:5 */
.cols-7-5 { display: grid; grid-template-columns: 7fr 5fr; gap: 18px; align-items: start; }
.row { display: flex; gap: 10px; align-items: center; }
.field { display: flex; flex-direction: column; gap: 4px; }
.ic { display: inline-flex; align-items: center; justify-content: center; }
.align-start { align-items: flex-start; }
.pt0 { padding-top: 0; }

/* 预览舞台 */
.stage { position: relative; }
.zoom-val { font-variant-numeric: tabular-nums; min-width: 44px; display: inline-block; text-align: center; }
.tip { font-size: 12.5px; color: var(--c-text-mute); }

/* 轻提示条 */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  padding: 10px 20px; border-radius: 22px; background: rgba(24, 31, 48, .92);
  color: #fff; font-size: 13.5px; z-index: 300; box-shadow: var(--shadow);
}
.toast[hidden] { display: none; }

/* 空状态里的主/副文案（.empty 基础样式在上方） */
.empty .t { font-size: 14.5px; font-weight: 600; color: var(--c-text-sub); }
.empty .d { font-size: 13px; color: var(--c-text-mute); margin-top: 3px; }
.empty .d code {
  padding: 1px 5px; background: var(--c-primary-soft); border-radius: 4px;
  font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--c-primary);
}

/* 操作列 / 按钮组：让一排按钮不被挤换行 */
.acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.table th.acts, .table td.acts { text-align: right; white-space: nowrap; }

/* 列表行：图标 + 主信息 + 右侧状态（充值记录 / 订单流水等） */
.list-row .ic {
  width: 34px; height: 34px; border-radius: 9px; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--c-primary-soft); color: var(--c-primary);
}
.list-row .ic i { font-size: 18px; }
.list-row .info { flex: 1 1 auto; min-width: 0; }
.list-row .a { font-size: 14px; font-weight: 600; }
.list-row .b { font-size: 12px; color: var(--c-text-mute); }

/* 卡片头部右侧的「全部 >」链接 */
.card-head .act {
  font-size: 13px; color: var(--c-text-mute); display: inline-flex;
  align-items: center; gap: 4px;
}
.card-head .act:hover { color: var(--c-primary); }
.card-head .act i { font-size: 15px; }

/* 状态徽章前的小圆点 */
.badge .dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; opacity: .65; margin-right: 6px; vertical-align: 1px;
}

/* 密钥盒展开态（默认脱敏，.is-open 表示当前正在明文展示） */
.key-box.is-open { background: #f3f7ff; border-color: #cddcf8; }

/* ---- 小屏适配 ---- */
@media (max-width: 720px) {
  .rc-presets { grid-template-columns: repeat(2, 1fr); }
  .pay-channels { flex-direction: column; }
  .pay-channel .pc-box { justify-content: center; }
  .uc-hero { padding: 18px; }
  .uc-hero-r { gap: 20px; }
  .uc-stat .v { font-size: 18px; }
  .key-value code { flex-basis: 100%; }
}
