/* ==========================================================================
   Tabler 主题 · 设计系统 v2
   --------------------------------------------------------------------------
   唯一的视觉真理源：所有页面级 CSS 只允许引用本文件的令牌，
   不允许再出现硬编码品牌色（#1890ff / #fa0712 / 彩虹渐变等）。

   色板：品牌蓝 #2563eb + 深蓝 #1d4ed8 + 强调金 #f59e0b + 深石板 #0f172a
   字阶：12 / 13 / 14 / 15 / 16 / 18 / 20 / 24 / 30 / 38 / 48
   间距：4 的倍数（4 / 8 / 12 / 16 / 20 / 24 / 32 / 40 / 48 / 64 / 80）
   圆角：6 / 8 / 12 / 16 / 20 / 999
   断点：1200 / 992 / 768 / 560
   ========================================================================== */

:root {
  /* —— 品牌色 —— */
  --brand-h: 217;
  --brand-s: 91%;
  --brand-l: 54%;
  --brand: #2563eb;
  --brand-strong: #1d4ed8;
  --brand-deep: #1e3a8a;
  --brand-soft: #eff6ff;
  --brand-line: #bfdbfe;
  --brand-fg: #ffffff;

  /* —— 强调金（仅用于数据、荣誉、关键 CTA 点缀） —— */
  --accent: #f59e0b;
  --accent-bright: #fbbf24;
  --accent-soft: #fffbeb;
  --accent-line: #fde68a;

  /* —— 中性色 —— */
  --ink-h: 222;
  --ink-s: 47%;
  --ink-l: 11%;
  --ink: #0f172a;
  --ink-2: #1e293b;
  --muted: #475569;
  --muted-2: #64748b;
  --faint: #94a3b8;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --surface-h: 218;
  --surface: #f6f8fb;
  --surface-2: #f1f5f9;
  --card: #ffffff;
  /* —— 悬浮填充 ——
     tabler.min.css 把 --tblr-hover-bg 写成 light-dark(color-mix(body-color 4%/6%, transparent))，
     落在白卡片上只有 #f4f5f6（与白底亮度差约 1.07:1）。.btn-ghost、.btn-action、分段选项卡、
     .link-hoverable 的悬浮底色全走这个令牌，不覆盖就是「鼠标移过去没反应」。
     抬到 10%：白底上得到 #eceef1，压在 --surface-2 卡片头（#f1f5f9）上也能看出色块。 */
  --hover-fill: rgba(15, 23, 42, .10);

  /* —— 语义色 —— */
  --success: #059669;
  --success-strong: #047857;
  --success-soft: #ecfdf5;
  --success-line: #a7f3d0;
  --warning: #d97706;
  --warning-strong: #b45309;
  --warning-soft: #fffbeb;
  --warning-line: #fde68a;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --danger-line: #fecaca;

  /* —— 圆角（Py common.css：卡片 12px、按钮/输入框 4~6px）—— */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 999px;

  /* —— 阴影 —— */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, .06), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-md: 0 4px 16px -4px rgba(15, 23, 42, .08), 0 2px 6px -2px rgba(15, 23, 42, .05);
  --shadow-lg: 0 16px 40px -12px rgba(15, 23, 42, .16), 0 6px 16px -8px rgba(15, 23, 42, .08);
  --shadow-brand: 0 10px 24px -8px rgba(37, 99, 235, .35);

  /* —— 动效 —— */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --transition: 180ms var(--ease);
  --transition-slow: 320ms var(--ease);

  /* —— 布局 —— */
  --container: 1200px;
  --container-wide: 1200px;
  --header-h: 70px;

  /* —— 间距阶梯（4 的倍数；新代码只允许引用这些档位，不再随手写 13px / 18px） —— */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;

  /* —— 字阶（12 / 13 / 14 / 15 / 16 / 18 / 20 / 24 / 30）——
     历史遗留的 12.25px（.875em）/ 13.5px / 14.5px / 15.5px 已全部收编到这些档位。 */
  --text-xs: 12px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-md: 15px;
  --text-lg: 16px;
  --text-xl: 18px;
  --text-2xl: 20px;
  --text-3xl: 24px;
  --text-4xl: 30px;

  /* —— 控件高度（按钮 / 输入框 / 下拉必须同高） —— */
  --control-h-sm: 32px;
  --control-h: 38px;
  --control-h-lg: 44px;

  /* —— 卡片圆角（Tabler 1.4 的 8px，比输入框的 --radius-md 更硬，是刻意区分的） —— */
  --radius-card: 8px;

  /* —— 层级（全站唯一阶梯；theme.css 内的 z-index 一律引用这些令牌） ——
     raised 局部抬升 · fixed 悬浮按钮/底部条 · sticky 吸顶栏/表头 ·
     dialog 弹层 · popover 下拉/二级导航 · loading 全屏加载 ·
     overlay 浮层（对话框/侧栏） · toast 通知栈 */
  --z-raised: 100;
  --z-fixed: 1020;
  --z-sticky: 1030;
  --z-dialog: 1035;
  --z-popover: 1040;
  --z-loading: 1060;
  --z-overlay: 1080;
  --z-toast: 1100;

  /* —— Tabler 桥接令牌（Tabler 组件与历史模板共用） —— */
  --tblr-primary: var(--brand);
  --tblr-primary-soft: var(--brand-soft);
  --tblr-primary-fg: var(--brand-fg);
  --tblr-heading-color: var(--ink);
  --tblr-body-color: var(--ink);
  --tblr-secondary-color: var(--muted-2);
  --tblr-tertiary-color: var(--faint);
  --tblr-border-color: var(--line);
  --tblr-hover-bg: var(--hover-fill);
  --tblr-border-radius: var(--radius-md);
  --tblr-box-shadow: var(--shadow-md);
  --tblr-card-bg: var(--card);
  --tblr-page-bg: var(--surface);
  --tblr-danger: var(--danger);
  --tblr-danger-soft: var(--danger-soft);
  --tblr-success: var(--success);
  --tblr-warning: var(--warning);
  --tblr-cyan: #0891b2;
  --tblr-orange: #ea580c;
  --tblr-purple: #7c3aed;
}

/* —— 深色模式 —— */
[data-bs-theme="dark"] {
  --ink: #e2e8f0;
  --ink-2: #cbd5e1;
  --muted: #cbd5e1;
  --muted-2: #94a3b8;
  --faint: #64748b;
  --line: #253044;
  --line-strong: #334155;
  --surface-h: 217;
  --surface: #0b1220;
  --surface-2: #111a2b;
  --card: #131d2e;
  /* 深色下白卡片换成 #131d2e，同一条 rgba(15,23,42,.10) 会越压越黑、几乎看不出来；
     改用浅墨色做加法，与浅色模式保持同一种「浮起一块」的强度。 */
  --hover-fill: rgba(226, 232, 240, .16);
  --brand-soft: #14233d;
  --brand-line: #1e3a8a;
  --accent-soft: #2a1f08;
  --accent-line: #4a3409;
  --success-soft: #0d2b22;
  --success-line: #14532d;
  --warning-soft: #2a1f08;
  --warning-line: #4a3409;
  --danger-soft: #2c1414;
  --danger-line: #5b1f1f;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .4);
  --shadow-md: 0 4px 16px -4px rgba(0, 0, 0, .5);
  --shadow-lg: 0 16px 40px -12px rgba(0, 0, 0, .6);
  --tblr-heading-color: var(--ink);
  --tblr-body-color: var(--ink);
  --tblr-secondary-color: var(--muted-2);
  --tblr-border-color: var(--line);
  --tblr-card-bg: var(--card);
  --tblr-page-bg: var(--surface);
}

/* ==========================================================================
   1. 基础
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  min-width: 320px;
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: Inter, "PingFang SC", "HarmonyOS Sans SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  /* 与 PythonCode py/common.css 保持同一正文口径 */
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 .5em;
  color: var(--ink);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.015em;
}

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--brand); text-decoration: none; transition: color var(--transition); }
/* tabler.min.css 里有 `a:hover{text-decoration:underline}`，特异性高于下面这条 `a`，
   只关基础态会让全站链接在鼠标悬停时冒出一条下划线（跟随文字色，深色标题下即"黑线"）。
   这里显式关掉 hover 下划线；需要下划线的组件（.card-header-link / .cms-fact-value / .auth-links）
   都用更高特异性单独打开了，不受影响。 */
a:hover { color: var(--brand-strong); text-decoration: none; }

img, svg, video { max-width: 100%; height: auto; }

hr { height: 1px; margin: 24px 0; border: 0; background: var(--line); }

button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }

::selection { background: var(--brand-soft); color: var(--brand-strong); }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Tabler Icons 兼容层：历史模板大量使用单前缀 class="ti-xxx"（缺 .ti 基类），
   此处补回字体族；对 "ti ti-xxx" 无副作用。 */
[class^="ti-"], [class*=" ti-"] {
  font-family: "tabler-icons" !important;
  font-style: normal;
  font-weight: 400;
  line-height: 1;
  text-transform: none;
  letter-spacing: normal;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  speak: none;
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   2. 通用工具类
   ========================================================================== */

.text-brand { color: var(--brand) !important; }
.text-accent { color: var(--accent) !important; }
.text-muted { color: var(--muted-2) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }

.bg-soft { background: var(--surface-2) !important; }
.divider { height: 1px; background: var(--line); }

.section-head { margin-bottom: 24px; text-align: center; }
.section-head h2 {
  margin: 0 0 10px;
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 800;
  letter-spacing: -.025em;
}
.section-head p { margin: 0; color: var(--muted-2); font-size: 15px; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  padding: 4px 12px;
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-pill);
  color: var(--brand-strong);
  background: var(--brand-soft);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
}

/* ==========================================================================
   3. 顶部导航
   ========================================================================== */

.site-topbar {
  border-bottom: 1px solid #f0f0f0;
  background: #fafafa;
  color: #999;
  font-size: 13px;
}
.site-topbar-inner {
  width: min(var(--container-wide), calc(100% - 40px));
  height: 46px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.site-topbar-links { display: flex; align-items: center; gap: 0 14px; color: #999; }
.site-topbar-links a { display: inline-flex; align-items: center; gap: 5px; color: #666; }
.site-topbar-links a:hover { color: var(--brand); }
.site-topbar-links a > .ti { color: #ff5722; font-size: 13px; }

/* 前台统一内容容器
   --------------------------------------------------------------------------
   所有带导航的前台页面，导航 ~ 页脚之间的内容都由 .page-shell 包裹，并与顶部
   导航 .header > .w1200 共用同一套宽度规则，任何视口下左右边缘都严格对齐。
   历史遗留的四种宽度（py .w1200 的 1170 / cms 壳 1200 / api、skill 详情 1184 /
   会员中心 1440）一并收敛到这里；纵向留白与内部栅格仍由各 pages/*.css 负责。 */
.page-shell,
.header > .w1200 {
  width: min(var(--container), calc(100% - 40px));
  margin-inline: auto;
  padding-inline: 0;
}
@media (max-width: 768px) {
  .page-shell,
  .header > .w1200 {
    /* 手机端统一边距：左右各 10px 用 width 实现（co-class 的 shorthand padding 覆盖不到 width），
       上下 15px 用 padding。Banner 类 co-class（.market-wrap/.skillmarket-wrap）会用自身 shorthand
       把纵向覆盖成通栏留白，正好让 Banner 紧贴导航、文字页拿到 15px。doc/formguide 等未走 wap
       漏斗、没有 .wap-content 的页面同样生效。 */
    width: calc(100% - 20px);
    padding: 15px 0;
  }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06);
}
[data-bs-theme="dark"] .site-header { background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%); }

.site-header-inner {
  width: min(var(--container-wide), calc(100% - 40px));
  min-height: var(--header-h);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 18px;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  max-width: 16em;
  color: #ffd700;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, .35);
  white-space: nowrap;
}
.site-brand:hover { color: #ffd700; }
.site-brand > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.site-brand img { width: 48px; height: 48px; object-fit: contain; border-radius: 50%; flex-shrink: 0; }
.site-brand-mark {
  width: 48px; height: 48px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 50%;
  color: #0f172a;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  box-shadow: 0 4px 14px rgba(245, 158, 11, .35);
  font-size: 24px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.site-nav::-webkit-scrollbar { display: none; }

.site-nav > a,
.site-nav-group > a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 44px;
  padding: 0 14px;
  margin: 3px 2px;
  border-radius: 8px;
  color: rgba(255, 255, 255, .82);
  font-size: var(--text-base);
  font-weight: 500;
  letter-spacing: .3px;
  white-space: nowrap;
  transition: color .25s, background-color .25s;
}
.site-nav > a::after,
.site-nav-group > a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 0;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  transform: translateX(-50%);
  transition: width .25s;
}
.site-nav > a:hover,
.site-nav-group > a:hover { color: #fff; background: rgba(255, 255, 255, .12); }
.site-nav > a:hover::after,
.site-nav-group > a:hover::after { width: 56%; }
.site-nav > a.active,
.site-nav-group > a.active {
  color: #fff;
  font-weight: 700;
  background: rgba(255, 255, 255, .16);
}
.site-nav > a.active::after,
.site-nav-group > a.active::after { width: 56%; }

.site-nav-group { position: relative; }
.site-nav-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: var(--z-popover);
  display: none;
  min-width: 190px;
  padding: 6px;
  border-top: 2px solid var(--brand);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  background: var(--card);
  box-shadow: 0 13px 42px 11px rgba(0, 0, 0, .12);
}
.site-nav-dropdown::before {
  content: "";
  position: absolute;
  top: -4px; left: 0; right: 0;
  height: 4px;
}
.site-nav-dropdown a {
  display: block;
  padding: 9px 12px;
  border-radius: var(--radius-xs);
  color: #666;
  font-size: var(--text-sm);
  font-weight: 500;
}
.site-nav-dropdown a:hover { color: var(--brand); background: #f9f9f9; }
.site-nav-group:hover .site-nav-dropdown,
.site-nav-group:focus-within .site-nav-dropdown { display: block; }

.site-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* 搜索框宽度收敛：导航含动态分类（最多 8 项），需给主导航让出横向空间 */
.site-search {
  position: relative;
  width: min(200px, 16vw);
  flex-shrink: 0;
}
.site-search .form-control {
  height: 38px;
  padding: 0 14px 0 36px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-size: var(--text-sm);
}
.site-search .form-control::placeholder { color: rgba(255, 255, 255, .5); }
.site-search .form-control:focus {
  border-color: rgba(255, 255, 255, .45);
  background: rgba(255, 255, 255, .14);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .08);
}
.site-search > .ti {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, .6);
  font-size: 15px;
  pointer-events: none;
}

/* 头部 CTA：金色主按钮 + 透明白描边次按钮（对齐 Py 侧 header 登录按钮） */
.site-actions .btn-login,
.site-actions .btn-login-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  white-space: nowrap;
  border-radius: 8px;
  font-size: 14px;
  transition: transform .25s, box-shadow .25s, background .25s, border-color .25s, color .25s;
}
.site-actions .btn-login {
  padding: 0 22px;
  border: 0;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #0f172a;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(245, 158, 11, .35);
}
.site-actions .btn-login:hover {
  color: #0f172a;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, .5);
}
.site-actions .btn-login-ghost {
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, .35);
  background: transparent;
  color: rgba(255, 255, 255, .92);
  font-weight: 600;
}
.site-actions .btn-login-ghost:hover { color: #fff; background: rgba(255, 255, 255, .12); border-color: #fff; }

/* 已登录用户按钮在深色头部下反转配色 */
.site-header .btn-white,
.site-header .member-user-button {
  border-color: rgba(255, 255, 255, .2);
  background: rgba(255, 255, 255, .1);
  color: #fff;
}
.site-header .btn-white:hover,
.site-header .member-user-button:hover { color: #fff; border-color: rgba(255, 255, 255, .4); background: rgba(255, 255, 255, .18); }

/* 移动端汉堡 + 抽屉 */
.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: var(--radius-sm);
  color: #fff;
  background: rgba(255, 255, 255, .08);
  font-size: 20px;
  cursor: pointer;
}
.nav-toggle:hover { background: rgba(255, 255, 255, .16); }
.nav-drawer { display: none; }

/* ==========================================================================
   4. 页面容器 / 卡片 / 统计
   ========================================================================== */

.page-container {
  width: min(var(--container), calc(100% - 40px));
  margin: 0 auto;
  padding: 32px 0 72px;
}
.page-container-narrow {
  width: min(920px, calc(100% - 40px));
  margin: 0 auto;
  padding: 32px 0 72px;
}
.page-title {
  margin: 0 0 8px;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 800;
  letter-spacing: -.03em;
}
.page-subtitle {
  margin: 0 0 26px;
  color: var(--muted-2);
  font-size: 15px;
  line-height: 1.75;
}

/* —— 卡片：规格逐项对齐 py 会员中心（Tabler 1.4.0 原生，admin.css 零覆盖）——
   py: --tblr-card-border-radius = --tblr-border-radius-lg = 8px；
       --tblr-card-spacer-y/x = 1rem/1.25rem → card-body padding 16px 20px；
       --tblr-card-cap-padding-y/x = 1rem/1.25rem → header/footer padding 16px 20px；
       --tblr-card-cap-bg = --tblr-bg-surface-tertiary（gray-50）→ 卡片头/尾有浅灰底。 */
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  /* 这两条以前只写在 py/common.css 里（本文件排在它之后却没声明），
     结果是「卡片圆角内溢出的表格」能不能被裁掉、悬浮变色有没有过渡，全看 py 那条规则是否还在。
     现在由本文件接管，py 侧的 .card 已删除。 */
  overflow: hidden;
  transition: box-shadow var(--transition), border-color var(--transition);
}
.card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
}
/* 卡片标题（py 侧写法是 <h5 class="mb-0"><i class="ti ti-xxx me-1"></i> 标题</h5>）：
   py 的 .card-title = 1rem / --tblr-font-weight-bold(600)，不是浏览器默认的 20px/700。 */
.card-header > h1, .card-header > h2, .card-header > h3,
.card-header > h4, .card-header > h5, .card-header > h6,
.card-header > .card-title {
  margin: 0;
  color: inherit;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}
.card-header .ti { color: var(--muted-2); font-size: 16px; }
/* 按钮内的图标必须跟随按钮变体着色：上一条的装饰灰调特异性 (0,2,0) 高于按钮 color 的继承，
   会把着色权抢走，导致表格工具条的「刷新/删除」按钮悬浮时文字变深（甚至变白）而图标仍停在
   灰色，看上去像没反应；btn-primary 蓝底上更是几乎看不见。这里用 (0,3,0) 把着色权交还按钮。 */
.card-header .btn .ti { color: inherit; }
.card-header .card-title + .card-actions { margin-left: auto; }
/* 选项卡内的多张卡片（如 appkey、参数配置）之间统一 16px 呼吸 */
.tab-pane > .card + .card { margin-top: 16px; }
.card-body { padding: 16px 20px; }
.card-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.card-stack { margin-bottom: 20px; }
.card-header-link {
  margin-left: auto;
  color: var(--brand);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}
.card-header-link:hover { text-decoration: underline; }

/* 页头说明块（替代模板里的浅蓝内联框） */
.theme-tip {
  margin-bottom: 15px;
  padding: 10px 15px;
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  color: var(--ink);
  font-size: var(--text-sm);
  line-height: 1.8;
}
/* 提醒型说明块（报名/提示条） */
.theme-tip-warn {
  margin-top: 10px;
  margin-bottom: 10px;
  padding: 10px 15px;
  border: 1px solid #fcd34d;
  border-radius: var(--radius-sm);
  background: #fffbeb;
  color: #b45309;
  font-size: 13px;
  line-height: 1.8;
}
.card-inset { margin: 15px; }
.tab-pad { padding: 20px 0; }
.theme-gap-sm { margin-top: 10px; }
.theme-gap-left { margin-left: 10px; }
/* 视觉隐藏但仍可聚焦（自定义单选卡片的 input） */
.sr-only-radio {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
/* 抬升效果只给显式加了 .card-hover 的卡片（营销卡片、统计卡片）。
   py/common.css 里那条裸 .card:hover{transform:translateY(-4px)} 已随 .card 一起删除，
   这里保留一条兜底，防止以后有人从 py 侧同步时把「鼠标一过就弹一下」带回来。 */
.card:hover { transform: none; }
.card-hover { transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition); }
.card-hover:hover {
  transform: translateY(-4px);
  border-color: var(--brand-line);
  box-shadow: var(--shadow-lg);
}

.surface {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
}

.stat-card {
  position: relative;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 100% 0, var(--brand-soft) 0, transparent 58%),
    var(--card);
  box-shadow: var(--shadow-xs);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--brand-line);
  box-shadow: var(--shadow-lg);
}
.stat-label { position: relative; z-index: 1; color: var(--muted-2); font-size: 13px; font-weight: 500; }
.stat-value {
  position: relative;
  z-index: 1;
  margin: 8px 0 4px;
  color: var(--ink);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1.1;
}
.stat-foot { position: relative; z-index: 1; color: var(--faint); font-size: 12px; }
.stat-value.is-brand { color: var(--ink); }
.stat-value.is-warn { color: var(--ink); }
.stat-value.is-success { color: var(--brand); }
.stat-value.is-muted { color: var(--ink); }

/* 轻量面板（控制台快速入口等内嵌区块） */
.theme-panel {
  margin-top: 20px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-xs);
}
.theme-panel-title { margin-bottom: 14px; color: var(--ink); font-size: 15px; font-weight: 700; }
.theme-panel-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 576px) {
  .theme-panel-actions .btn { flex: 1 1 auto; }
}

/* 控制台/表格内联收口：金额、状态、次要文案（替代模板里的 color:#xxx） */
.theme-money { color: #dc2626; font-weight: 700; font-variant-numeric: tabular-nums; }
.theme-warn { color: #d97706; }
.theme-ok { color: #059669; font-weight: 600; }
.theme-muted { color: var(--muted-2); }
.theme-muted-sm { margin-top: 4px; color: var(--muted-2); font-size: 12px; line-height: 1.6; }
.theme-link { color: var(--brand); }
.theme-link-strong { color: var(--ink); font-weight: 600; }
.theme-link-strong:hover { color: var(--brand); }
.theme-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--muted-2);
  word-break: break-all;
}
.theme-copy { margin-left: 6px; color: var(--brand); font-size: 11px; text-decoration: none; }
.theme-note { margin: 0; line-height: 38px; }
.key-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .4px;
}
.theme-textarea { min-height: 150px; }
/* 独立弹层页标题（联系客服等 header_common 页） */
.popup-title {
  margin: 0 0 12px;
  padding: 0 15px;
  color: var(--ink);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.4;
}
@media (max-width: 768px) {
  .popup-title { padding: 0; font-size: 18px; }
}
/* 二维码图（联系客服页）：白底 + 细边框，避免透明 PNG 落在灰底上 */
.theme-qr {
  display: block;
  width: 200px;
  max-width: 100%;
  height: auto;
  margin-top: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
}
/* 必填标记：py 侧写法是 <span class="text-danger">*</span>，
   取色 --danger，字重继承 label（不加粗）。
   .form-label-required 是 cms 内容表单的历史类名，样式原本只写在 pages/cms.css，
   跨模块复用 inputItem 的页面不会加载它——两个类名语义相同，必须都在这里可用。 */
.form-label-required { margin-left: 4px; color: var(--danger); font-weight: inherit; }
/* .req-mark 的间距由模板自带的空格提供（会员中心 / 表单引导的写法），
   这里不再加 margin，避免与模板空格叠成 7.5px。 */
.req-mark { color: var(--danger); font-weight: inherit; }
.theme-pre {
  margin: 0;
  padding: 12px 14px;
  max-height: 280px;
  overflow: auto;
  border: 1px solid #1f2937;
  border-radius: var(--radius-sm);
  background: #0f172a;
  color: #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
}
.table.table-flush { margin-bottom: 0; }

/* —— 表单内上传清单（pc/member/inputItem、pc/formguide/inputItem 的 file/files 字段）——
   行由 theme.js 上传组件动态插入（.file-box > tr.file-item），只是表单里的一个控件，
   不是页面主体数据表，因此不套 .card.table-card；这里只把它压成一张紧凑的小表。 */
.table.theme-upload-table { margin-bottom: 0; font-size: 13px; }
.table.theme-upload-table > thead > tr > th { color: var(--muted-2); font-weight: 500; white-space: nowrap; }
.table.theme-upload-table > tbody > tr > td { vertical-align: middle; }

/* —— editormd 的 Markdown 源文容器 ——
   #content-view 里的 <textarea> 只负责把原文交给 editormd，渲染结果写进同一容器的兄弟节点，
   源文必须隐藏（detail.html / skill/detail.html 共用）。 */
.md-src { display: none; }

/* 列表筛选工具条：右对齐，窄屏塌成整行 */
.theme-toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 15px; }
.theme-form-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}
.theme-form-toolbar > .field-control { width: auto; flex: 0 0 auto; }
.theme-form-row > .theme-form-toolbar { flex: 1; min-width: 0; }
.field-control.field-narrow { width: 130px; }
.field-control.field-mid { width: 240px; }
.field-control.field-wide { width: 100%; }
.theme-form-row > .field-control.field-wide { max-width: 720px; }
@media (max-width: 768px) {
  .theme-form-toolbar { justify-content: stretch; }
  .theme-form-toolbar > .field-control { flex: 1 1 auto; width: auto; }
  .field-control.field-narrow, .field-control.field-mid { width: 100%; }
  .theme-form-row > .field-control.field-wide { max-width: none; }
}

.badge-soft {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  color: var(--brand-strong);
  background: var(--brand-soft);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
  white-space: nowrap;
}
.badge-soft.success { color: var(--success); background: var(--success-soft); }
.badge-soft.warning { color: var(--warning); background: var(--warning-soft); }
.badge-soft.danger { color: var(--danger); background: var(--danger-soft); }

/* ==========================================================================
   5. 按钮 / 表单
   ========================================================================== */

/* —— 按钮：规格逐项对齐 py 会员中心（Tabler 1.4.0 原生 .btn）——
   py: --tblr-btn-padding-y/x = .5625rem/1rem → 9px 16px；
       --tblr-btn-font-size = .875rem → 14px；--tblr-btn-line-height = 1.25rem → 20px；
       --tblr-btn-font-weight = --tblr-font-weight-medium → 500；
       --tblr-btn-border-radius = --tblr-border-radius → 6px；
       min-height = 20 + 9*2 + 1*2 = 40px；box-shadow = --tblr-shadow-input。
   py 的 .btn 没有 hover 位移（仅颜色过渡），故不再 translateY。 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 9px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  transition: background var(--transition), border-color var(--transition),
              color var(--transition), box-shadow var(--transition);
}

.btn-primary {
  --tblr-btn-color: #fff;
  --tblr-btn-bg: var(--brand);
  --tblr-btn-border-color: var(--brand);
  --tblr-btn-hover-bg: var(--brand-strong);
  --tblr-btn-hover-border-color: var(--brand-strong);
  box-shadow: 0 1px 2px rgba(37, 99, 235, .25);
}
.btn-primary:hover { box-shadow: var(--shadow-brand); }
.btn-outline-primary {
  --tblr-btn-color: var(--brand);
  /* 模板里仍有 `btn btn-primary btn-outline-primary` 双类写法（查看详情、修改、复制安装指令、弹窗按钮等
     真正可点击的次级按钮）。两个类特异性相同，本类在后只改文字色、没给背景变量，背景仍是 .btn-primary
     的品牌蓝 → 蓝底蓝字。这里显式把背景置空，双类元素一律回到描边样式。
     纯展示用的「状态」（已添加/已支付/已结算…）不要再走双类，改用下面的 .btn-status-*。 */
  --tblr-btn-bg: transparent;
  --tblr-btn-border-color: var(--brand-line);
  --tblr-btn-hover-bg: var(--brand);
  --tblr-btn-hover-color: #fff;
  --tblr-btn-hover-border-color: var(--brand);
  box-shadow: none;
}
/* —— outline 语义色兜底 ——
   历史模板存在 `btn btn-primary btn-outline-danger`、`btn btn-primary btn-outline-warning`
   这类双类写法：.btn-primary 在 theme.css 里显式给了品牌蓝底，源序晚于 tabler.min.css
   的 .btn-outline-* 透明底规则，于是渲染成「蓝底红字 / 蓝底黄字」，删除按钮看着和主按钮
   一样、只是字变了色。这里给语义 outline 显式声明背景/边框/悬浮色，让双类也能还原成
   「删除=红、警告=黄、取消=灰」的描边按钮。新写模板请直接用单类。 */
.btn-outline-danger {
  --tblr-btn-color: var(--danger);
  --tblr-btn-bg: transparent;
  --tblr-btn-border-color: var(--danger-line);
  --tblr-btn-hover-color: #fff;
  --tblr-btn-hover-bg: var(--danger);
  --tblr-btn-hover-border-color: var(--danger);
  box-shadow: none;
}
.btn-outline-warning {
  --tblr-btn-color: var(--warning-strong);
  --tblr-btn-bg: transparent;
  --tblr-btn-border-color: var(--warning-line);
  --tblr-btn-hover-color: #fff;
  --tblr-btn-hover-bg: var(--warning);
  --tblr-btn-hover-border-color: var(--warning);
  box-shadow: none;
}
/* 表格工具条的刷新按钮就是这个变体，它由 theme.js 渲染进 .card-header（底色 --surface-2）。
   历史上悬浮底色也写成 --surface-2，与卡片头同色 → hover 完全没有反馈；同组的
   outline-primary / danger / warning 都是「用自身语义色铺满 + 白字」，这里向它们对齐。
   静止色也从 --muted-2 提到 --muted：12px 的「刷新」二字在 #f1f5f9 上原本只有 4.34:1，
   低于 WCAG AA 正文 4.5:1；提到 #475569 后为 6.92:1，描边同时用 --line-strong 让按钮轮廓可见。
   注意悬浮文字色用 --card 而不是 #fff：--muted 在深色模式下翻成 #cbd5e1（浅），写死白字
   就会变成「浅底白字」；--card 与之同步翻成 #131d2e，两个模式下都是深字浅底 / 浅字深底。 */
.btn-outline-secondary {
  --tblr-btn-color: var(--muted);
  --tblr-btn-bg: transparent;
  --tblr-btn-border-color: var(--line-strong);
  --tblr-btn-hover-color: var(--card);
  --tblr-btn-hover-bg: var(--muted);
  --tblr-btn-hover-border-color: var(--muted);
  box-shadow: none;
}
.btn-white {
  border-color: var(--line);
  background: var(--card);
  color: var(--ink);
}
.btn-white:hover { border-color: var(--brand-line); color: var(--brand); }
/* py: .btn-sm = padding-y .3125rem(5px) / padding-x .5rem(8px) / font-size .75rem(12px)
        / line-height 1.3333(16px) / radius --tblr-border-radius-sm(4px) → min-height 28px。
   .btn-lg 与 .btn-icon py 无自定义，保持与 .btn 同高。 */
.btn-sm { min-height: 28px; padding: 5px 8px; border-radius: 4px; font-size: 12px; line-height: 16px; }
.btn-lg { min-height: 44px; padding: 11px 20px; font-size: 16px; }
.btn-icon { width: 40px; height: 40px; padding: 0; display: inline-grid; place-items: center; }
.btn-sm.btn-icon { width: 28px; height: 28px; }

/* —— 状态标签 ——
   历史模板习惯把按钮类当状态标签用（已支付/已结算/成功…），并混用
   `btn btn-primary btn-outline-primary`、`btn btn-primary btn-outline-warning` 这类双类写法：
   .btn-primary 给品牌蓝实底 + 白字，outline 类只覆盖文字/边框色，两层叠起来就是
   「蓝底彩色字」甚至「蓝底蓝字」；再叠 disabled 的 .65 透明度，整块浅色、字都看不见
   （接口详情「已添加」曾如此）。这里给状态标签一套独立的语义配色：
   沿用 .btn 的尺寸（模板仍配 .btn-sm），但不可点击、不位移、不因 disabled 变淡。 */
.btn-status-ok {
  --tblr-btn-color: var(--success-strong);
  --tblr-btn-bg: var(--success-soft);
  --tblr-btn-border-color: var(--success-line);
  --tblr-btn-hover-color: var(--success-strong);
  --tblr-btn-hover-bg: var(--success-soft);
  --tblr-btn-hover-border-color: var(--success-line);
}
.btn-status-info {
  --tblr-btn-color: var(--brand-strong);
  --tblr-btn-bg: var(--brand-soft);
  --tblr-btn-border-color: var(--brand-line);
  --tblr-btn-hover-color: var(--brand-strong);
  --tblr-btn-hover-bg: var(--brand-soft);
  --tblr-btn-hover-border-color: var(--brand-line);
}
.btn-status-warn {
  --tblr-btn-color: var(--warning-strong);
  --tblr-btn-bg: var(--warning-soft);
  --tblr-btn-border-color: var(--warning-line);
  --tblr-btn-hover-color: var(--warning-strong);
  --tblr-btn-hover-bg: var(--warning-soft);
  --tblr-btn-hover-border-color: var(--warning-line);
}
.btn-status-danger {
  --tblr-btn-color: var(--danger);
  --tblr-btn-bg: var(--danger-soft);
  --tblr-btn-border-color: var(--danger-line);
  --tblr-btn-hover-color: var(--danger);
  --tblr-btn-hover-bg: var(--danger-soft);
  --tblr-btn-hover-border-color: var(--danger-line);
}
.btn-status-muted {
  --tblr-btn-color: var(--muted-2);
  --tblr-btn-bg: var(--surface-2);
  --tblr-btn-border-color: var(--line);
  --tblr-btn-hover-color: var(--muted-2);
  --tblr-btn-hover-bg: var(--surface-2);
  --tblr-btn-hover-border-color: var(--line);
}
/* 实心「已完成」：按钮区（如接口详情「已添加」）与主按钮并排，需要同等分量的可见度 */
.btn-status-done {
  --tblr-btn-color: #fff;
  --tblr-btn-bg: var(--success-strong);
  --tblr-btn-border-color: var(--success-strong);
  --tblr-btn-hover-color: #fff;
  --tblr-btn-hover-bg: var(--success-strong);
  --tblr-btn-hover-border-color: var(--success-strong);
}
.btn-status-ok, .btn-status-info, .btn-status-warn,
.btn-status-danger, .btn-status-muted, .btn-status-done {
  box-shadow: none;
  cursor: default;
  pointer-events: none;
}
/* 状态标签上的 disabled 只作语义标记，不要被 Bootstrap 的 .65 透明度抹淡 */
.btn-status-ok:disabled, .btn-status-ok.disabled,
.btn-status-info:disabled, .btn-status-info.disabled,
.btn-status-warn:disabled, .btn-status-warn.disabled,
.btn-status-danger:disabled, .btn-status-danger.disabled,
.btn-status-muted:disabled, .btn-status-muted.disabled,
.btn-status-done:disabled, .btn-status-done.disabled { opacity: 1; }

.btn-accent {
  border: 0;
  color: #3f2d05;
  background: linear-gradient(135deg, var(--accent-bright), var(--accent));
  box-shadow: 0 8px 20px -8px rgba(245, 158, 11, .6);
  font-weight: 700;
}
.btn-accent:hover { color: #3f2d05; box-shadow: 0 12px 26px -8px rgba(245, 158, 11, .7); }

/* —— 表单控件：规格逐项对齐 py 会员中心（Tabler 1.4.0 原生）——
   py .form-control: padding .5625rem 1rem → 9px 16px；font-size .875rem → 14px；
     line-height 1.25rem → 20px；border-radius --tblr-border-radius → 6px（= --radius-sm）；
     background --tblr-bg-forms(#fff)；box-shadow --tblr-shadow-input；高 = 20+18+2 = 40px。
   py .form-select: 右侧留给下拉箭头，padding .5625rem 3rem .5625rem 1rem。
   py .form-control-sm: min-height 32px / padding 5px 8px / font-size 12px / radius 4px。
   py focus 仅改 border-color（保留 shadow-input），不是 3px 光环。 */
.form-label { margin-bottom: 8px; color: var(--ink); font-size: 14px; font-weight: 500; }
.form-control, .form-select {
  min-height: 40px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background-color: var(--card);
  color: var(--ink);
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  box-shadow: 0 1px 1px rgba(15, 23, 42, .06);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-select { padding-right: 48px; }
.form-control-sm, .form-select-sm {
  min-height: 32px;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 16px;
}
.form-control-sm.form-select, .form-select-sm { padding-right: 32px; }
.form-control::placeholder { color: var(--faint); }
.form-control:focus, .form-select:focus {
  border-color: var(--brand);
  box-shadow: 0 1px 1px rgba(15, 23, 42, .06);
}
.form-control:disabled, .form-control[readonly] {
  background: var(--surface-2);
  color: var(--muted-2);
}
/* py 用 <small class="form-hint">：color --tblr-secondary(#6b7280)，字号原为 .875em（=12.25px），
   现已收编到 --text-xs（12px），不再保留半像素档位。 */
.form-text { margin-top: 4px; color: var(--muted-2); font-size: var(--text-xs); }
/* py .form-check: min-height 1.25rem(20px)；.form-check-input 20×20；
   .form-check-inline margin-right 1rem(16px)。 */
/* Tabler 原生 .form-check 是「float 的 input + padding-inline-start:2rem + width:fit-content」这套排版，
   本主题已把它改成 flex（float 随之失效），但那 2rem 内边距与 fit-content 没被重置：
   放进 flex 容器后 fit-content 会塌成 min-content，2rem 又吃掉大半宽度，
   标签只剩一个汉字宽，「开启」被拆成竖排两行（appkey 页实测 label 宽 24px、高 44.8px）。
   把 --tblr-form-check-padding-start 归零，Tabler 自己的 padding 与 input 负 margin 会一起归零；
   纵向间距交给容器的 gap，不再用 Tabler 的 margin-bottom。 */
.form-check {
  --tblr-form-check-padding-start: 0rem;
  min-height: 20px;
  margin-bottom: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto;
  flex: 0 0 auto;
}
.form-check-input {
  width: 20px;
  height: 20px;
  margin: 0;
  margin-inline-start: 0;
  float: none;
  flex: 0 0 auto;
  border-color: var(--line-strong);
  box-shadow: 0 1px 1px rgba(15, 23, 42, .06);
}
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-label { font-size: 14px; }

.form-shell { max-width: 760px; }
.form-shell .form-control, .form-shell .form-select { min-height: 44px; }
/* py 的 .form-control 是 width:100%，不再限 420px */
.field-control { width: 100%; }

/* 表单内未写 class 的裸 select（控制台筛选、申请接口等）与 .form-select 对齐 */
.theme-form select {
  width: 100%;
  min-height: 38px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background-color: var(--card);
  color: var(--ink);
  font-size: 14px;
}
.theme-form select:focus {
  border-color: var(--brand);
  outline: 0;
  box-shadow: 0 0 0 3px var(--brand-soft);
}

/* .theme-legacy 是 layui 时代遗留的「旧控件容器」包裹类，本身没有任何样式；
   必填标记统一用 .req-mark，不要再在容器上用 ::after 追加星号。 */

/* 验证码行 */
.verify-box .field-control { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; width: min(100%, 460px); }
.verify-box .form-control { flex: 1; min-width: 140px; }
.captcha { width: auto; height: 42px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); cursor: pointer; }

/* ==========================================================================
   6. 会员中心布局
   ========================================================================== */

.app-shell {
  /* 会员中心是全屏工作台（口径：用户中心要全屏、不设宽度）：
     侧栏是从视口顶端落地的固定竖栏（见 .app-sidebar），左深右白两列贯穿整屏。
     内容区用 padding-left 给 fixed 侧栏让位，不再用 grid——fixed 元素已脱离文档流，
     再由 grid 第一列占位会多空出一条 252px。 */
  width: 100%;
  margin-inline: 0;
  padding-left: 252px;
  min-height: calc(100vh - var(--header-h));
}
.app-sidebar {
  /* fixed + top/bottom 0：侧栏从页面最顶端一直延伸到底部（不再从会员顶条下方开始），
     页面滚动时侧栏不动、右侧内容列独立滚动。宽度与 .app-shell 的 padding-left 同为 252px，
     改一边必须同步改另一边。 */
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 252px;
  overflow-y: auto;
  padding: 20px 14px 24px;
  border-right: 1px solid rgba(255, 255, 255, .07);
  /* 与 PythonCode 会员中心侧栏同一底色（Tabler dark navbar：#1f2937），不再用自定义渐变 */
  background: #1f2937;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .22) transparent;
}
.app-sidebar-inner { display: flex; flex-direction: column; gap: 18px; }
.app-menu { margin: 0; padding: 0; list-style: none; }
.app-menu > li + li { margin-top: 10px; }
.app-menu > li > a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 6px;
  border-radius: 0;
  color: rgba(229, 231, 235, .86);
  /* 分组标题在深色侧栏上偏小：原用 --text-base（14px），按要求 +2px 到 16px。
     写定值不改 token——--text-base 是全站正文基准，改它会连带影响所有正文。
     二级菜单 15px 仍比它小 1px，配合 600 字重与左缩进保持层级差。 */
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: color var(--transition);
}
.app-menu > li > a > .ti:first-child { font-size: 18px; color: rgba(229, 231, 235, .7); }
/* 分组标题不给底色块（Py 版只在子项上标选中），只做颜色变化 */
.app-menu > li > a:hover,
.app-menu > li.active > a { color: #fff; }
.app-menu > li > a:hover > .ti:first-child,
.app-menu > li.active > a > .ti:first-child { color: #fff; }
/* 子菜单：靠缩进表达层级，不用左侧竖线；选中项铺 rgba(0,0,0,.2) 深色块（同 Tabler --tblr-navbar-active-bg） */
.app-menu .dropdown-menu {
  position: static;
  display: none;
  margin: 0 0 4px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.app-menu > li.active .dropdown-menu { display: block; }
.app-menu .dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 12px 12px 42px;
  border-radius: 0;
  color: rgba(229, 231, 235, .72);
  /* 二级菜单原用 --text-sm（13px），在深灰侧栏上偏小；按要求 +2px 到 15px（分组标题为 16px） */
  font-size: 15px;
  transition: color var(--transition), background var(--transition);
}
.app-menu .dropdown-menu a:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.app-menu .dropdown-menu a.active {
  color: #fff;
  background: rgba(0, 0, 0, .2);
  font-weight: 500;
}

/* 内容区铺满侧栏右侧的全部视口宽度，不再有 max-width / margin auto，宽屏下也不会出现两侧大片空白。
   左右内边距 2026-12-03 定稿：桌面维持 24px 不变，只有手机断点（≤768px）收到 10px，
   与全站前台 .page-shell 的手机口径一致；平板断点（≤992px）仍是 20px。
   上下 24px / 40px 呼吸任何断点都不动。 */
.app-content { min-width: 0; width: 100%; margin-inline: 0; padding: 24px 24px 40px; }
.member-surface { min-height: calc(100vh - 124px); }

/* —— 侧栏品牌头：站点简称 ——
   原 .sidebar-user（头像 + 用户名 + UID）与顶部条右侧的用户下拉完全重复，
   改成整条深色竖栏的品牌起点：金色站名 + 琥珀渐变 API 方块，与前台头部 .site-brand
   同一套品牌语言（#ffd700 金字 + linear-gradient(135deg,#fbbf24,#f59e0b)），
   只是尺寸收小（方块 36px、字 17px），不抢下方菜单的注意力。
   站名取 config('web_site_jc')，过长时省略号截断；底部细线把品牌区与菜单分开。 */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 0 4px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  color: #ffd700;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 1.2px;
  transition: color var(--transition);
}
.sidebar-brand:hover { color: #ffd700; }
.sidebar-brand-mark {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: #0f172a;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  box-shadow: 0 4px 12px rgba(245, 158, 11, .28);
  font-size: 19px;
  transition: box-shadow var(--transition);
}
.sidebar-brand:hover .sidebar-brand-mark { box-shadow: 0 6px 16px rgba(245, 158, 11, .45); }
.sidebar-brand-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}

.member-header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  /* 顶部条只铺右侧内容列：左侧 252px 让给从视口顶端落地的全高侧栏。 */
  margin-left: 252px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}
.member-header-inner {
  /* 顶部会员条与下方全屏工作台共用左右 24px 边距，与侧栏左缘对齐 */
  width: 100%;
  min-height: var(--header-h);
  margin: 0;
  padding-inline: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.member-topnav { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; }
.member-topnav a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border-radius: var(--radius-sm);
  color: var(--muted-2);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: color var(--transition), background var(--transition);
}
.member-topnav a:hover { color: var(--brand); background: var(--brand-soft); }
.member-header-actions { display: flex; align-items: center; gap: 10px; }
/* 【首页】与【消息】同款快捷入口，手机端只显示图标。
   图标是这两个入口的唯一视觉主体（尤其手机端），必须撑到与 32px 头像按钮同一体量：
   只继承 13px 正文字号会缩成一小点，和右侧头像差距过大。 */
.member-home-link,
.member-message-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border-radius: var(--radius-sm);
  color: var(--muted-2);
  font-size: 13px;
  font-weight: 600;
  transition: color var(--transition), background var(--transition);
}
.member-home-link .ti,
.member-message-link .ti { font-size: 22px; }
.member-home-link:hover,
.member-message-link:hover { color: var(--brand); background: var(--brand-soft); }
.member-message-link .badge { min-width: 18px; padding: 3px 5px; font-size: 10px; }
.member-user-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 220px;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: transparent;
  font-size: 13px;
  font-weight: 650;
  transition: background var(--transition), border-color var(--transition);
}
.member-user-button:hover { border-color: var(--line); background: var(--surface-2); }
.member-user-button > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.menu-arrow { margin-left: auto; font-size: 14px; transition: transform var(--transition); }
.app-menu > li.active > a > .menu-arrow { transform: rotate(90deg); }

.avatar { border-radius: 50%; object-fit: cover; background: var(--brand-soft); }
.avatar-sm { width: 32px; height: 32px; }
.avatar-md { width: 44px; height: 44px; }
.avatar-lg { width: 72px; height: 72px; }

.dropdown-menu {
  padding: 6px;
  border-color: var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-xs);
  color: var(--muted);
  font-size: var(--text-sm);
}
.dropdown-item:hover { color: var(--brand); background: var(--brand-soft); }
.dropdown-item.active, .dropdown-item:active { color: #fff; background: var(--brand); }
.dropdown-divider { border-color: var(--line); }

/* ==========================================================================
   7. 认证页（登录 / 注册 / 找回密码）
   ========================================================================== */

.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(400px, .94fr);
  background: var(--card);
}
.auth-art {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(36px, 6vw, 76px);
  color: #fff;
  background: linear-gradient(150deg, #0f172a 0%, #1e3a8a 55%, #2563eb 100%);
}
.auth-art::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .5;
  background-image:
    radial-gradient(circle at 18% 22%, rgba(251, 191, 36, .22), transparent 42%),
    radial-gradient(circle at 82% 78%, rgba(59, 130, 246, .35), transparent 46%),
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: auto, auto, 46px 46px, 46px 46px;
}
.auth-art > * { position: relative; z-index: 1; }
.auth-art h1 {
  max-width: 620px;
  color: #fff;
  font-size: clamp(32px, 4.6vw, 52px);
  line-height: 1.14;
  letter-spacing: -.04em;
}
.auth-art p {
  max-width: 560px;
  color: rgba(226, 232, 240, .9);
  font-size: 16px;
  line-height: 1.85;
}
.auth-panel {
  display: grid;
  place-items: center;
  padding: 44px 40px;
  background: var(--card);
}
.auth-card { width: min(100%, 420px); }
.auth-card-wide { width: min(100%, 470px); }
.auth-card h1, .auth-card h2 {
  margin: 0 0 8px;
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -.03em;
}
.auth-card .page-subtitle { margin-bottom: 28px; }
.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 19px;
  font-weight: 800;
}
.auth-brand:hover { color: #fff; }
.auth-brand i {
  width: 38px; height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .26);
  border-radius: 11px;
  background: rgba(255, 255, 255, .1);
  font-size: 20px;
}
.auth-art-copy { max-width: 660px; margin: 64px 0; }
.auth-art-copy .auth-art-title {
  margin: 0 0 18px;
  color: #fff;
  font-size: clamp(28px, 3.2vw, 42px);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: -.025em;
}
.auth-art-copy .auth-art-desc {
  margin: 0;
  max-width: 34em;
  color: rgba(226, 232, 240, .86);
  font-size: var(--text-md);
  line-height: 1.9;
}
.auth-art-copy .eyebrow {
  border-color: rgba(251, 191, 36, .35);
  color: var(--accent-bright);
  background: rgba(251, 191, 36, .12);
}
.auth-art-meta { display: flex; flex-wrap: wrap; gap: 12px 28px; color: rgba(226, 232, 240, .85); font-size: 13px; }
.auth-art-meta span { display: inline-flex; align-items: center; gap: 8px; }
.auth-art-meta i { color: var(--accent-bright); font-size: 17px; }
.auth-aside-note { display: flex; flex-wrap: wrap; gap: 10px 20px; color: rgba(226, 232, 240, .78); font-size: 13px; }

.auth-card-header { margin-bottom: 30px; }
.auth-card-header h1 { letter-spacing: -.03em; }
.auth-card-header p { margin: 0; color: var(--muted-2); line-height: 1.7; }
.auth-icon {
  width: 48px; height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 20px;
  border-radius: var(--radius-md);
  color: var(--brand);
  background: var(--brand-soft);
  font-size: 23px;
}
.auth-card .form-row { display: block; margin-bottom: 18px; }
.auth-card .form-row > .form-label { display: block; padding: 0 0 8px; text-align: left; }
.auth-card .form-row > .form-control-wrap { max-width: none; }
.auth-card .form-label { display: block; margin-bottom: 8px; font-weight: 650; }
.auth-card .form-control { min-height: 46px; }

.password-field { position: relative; }
.password-field > .form-control { padding-right: 48px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 5px;
  width: 38px; height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--faint);
  background: transparent;
  transform: translateY(-50%);
}
.password-toggle:hover { color: var(--brand); background: var(--brand-soft); }

.auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 18px 0 22px;
  font-size: 13px;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 18px;
  color: var(--faint);
  font-size: 12px;
}
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-third-party { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.auth-third-party:empty { display: none; }
.auth-third-party a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--card);
  color: var(--muted);
  font-size: 20px;
  text-decoration: none;
  transition: border-color var(--transition), background var(--transition), color var(--transition), transform var(--transition);
}
.auth-third-party a:hover {
  border-color: var(--brand-line);
  background: var(--brand-soft);
  color: var(--brand);
  transform: translateY(-1px);
}
.auth-switch { margin: 24px 0 0; color: var(--muted-2); text-align: center; font-size: 13px; }
.auth-switch a { font-weight: 650; }
.auth-community {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  color: var(--muted-2);
  background: var(--surface-2);
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
}
.input-action { display: flex; gap: 8px; align-items: stretch; }
.input-action > .form-control { flex: 1; min-width: 0; }
.input-action > .btn { flex: 0 0 auto; white-space: nowrap; }
.auth-card #ajcaptcha-container-login, .auth-card #ajcaptcha-container-reg { min-height: 38px; }

/* —— 7.1 独立认证页（登录 / 注册 / 找回密码）：Py 侧口径的紫渐变居中卡片，无导航无左侧插图 —— */
.auth-standalone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.auth-shell { width: min(100%, 420px); }
.auth-site {
  display: block;
  margin: 0 0 24px;
  color: #fff;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: .04em;
  text-align: center;
}
.auth-site:hover { color: #fff; }
.auth-standalone .auth-card {
  width: 100%;
  padding: 30px 26px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 22px 48px -18px rgba(23, 23, 64, .5);
}
.auth-standalone .auth-title {
  margin: 0 0 24px;
  color: #1f2937;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0;
  text-align: center;
}
.auth-standalone .auth-card .form-row { margin-bottom: 16px; }
.auth-standalone .auth-card .form-label { margin-bottom: 6px; color: #374151; font-size: 13px; font-weight: 600; }
.auth-standalone .auth-card .form-control {
  min-height: 42px;
  padding: 8px 12px;
  border-color: #e5e7eb;
  border-radius: 6px;
  background: #f9fafb;
  font-size: 14px;
}
.auth-standalone .auth-card .form-control:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.auth-standalone .auth-card .password-field > .form-control { padding-right: 44px; }
.auth-standalone .auth-card .input-action > .form-control { min-height: 44px; }
.auth-standalone .auth-card .form-check-input { border-color: #6b7280; background-color: #fff; }
.auth-standalone .auth-card .btn { height: 44px; border-radius: 6px; font-size: 15px; font-weight: 600; }
.auth-standalone .auth-card .btn i { margin-left: 4px; }
.auth-standalone .auth-options { justify-content: flex-start; margin: 2px 0 20px; color: #6b7280; font-size: 13px; }
.auth-standalone .auth-divider { margin: 20px 0 14px; color: #9ca3af; }
.auth-standalone .auth-sync { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.sync-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 6px;
  color: #fff;
  font-size: 13px;
  line-height: 1.6;
  text-decoration: none;
  transition: opacity .2s;
}
.sync-btn:hover { color: #fff; opacity: .85; }
.sync-btn-qq { background: #12b7f5; }
.sync-btn-wx { background: #07c160; }
.auth-links { margin: 18px 0 0; color: rgba(255, 255, 255, .85); font-size: 13px; text-align: center; }
.auth-links a { color: rgba(255, 255, 255, .92); }
.auth-links a:hover { color: #fff; text-decoration: underline; }
.auth-links .sep { margin: 0 8px; color: rgba(255, 255, 255, .5); }
.auth-standalone .auth-community {
  margin: 14px 0 0;
  padding: 10px 14px;
  border-radius: 6px;
  color: rgba(255, 255, 255, .85);
  background: rgba(255, 255, 255, .14);
  font-size: 12px;
  text-align: center;
}
.auth-standalone .auth-community a { color: #fff; }

/* ==========================================================================
   8. 市场（API 大厅）
   ========================================================================== */

/* 市场 Hero：直接采用 Py 市场页（app/static/cms/css/market.css）的白底居中版式 */
.market-hero { padding: 40px 0 30px; text-align: center; }
.market-hero h1 { margin: 0 0 12px; color: #333; font-size: 28px; font-weight: 700; }
.market-hero p { color: #666; font-size: 14px; line-height: 1.7; }
.market-hero .market-hero-desc { margin: -4px 0 18px; color: #666; font-size: 14px; }
.market-hero-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; margin: 0 0 28px; }
.market-hero-tag { display: inline-flex; align-items: center; gap: 4px; color: #666; font-size: 14px; }
.market-hero-tag i { color: #1e9fff; font-size: 13px; }

.market-search-form {
  display: flex;
  align-items: stretch;
  max-width: 560px;
  margin: 0 auto 16px;
}
.market-search-form input {
  flex: 1;
  min-width: 0;
  height: 46px;
  padding: 0 16px;
  border: 1px solid #d9d9d9;
  border-right: 0;
  border-radius: 6px 0 0 6px;
  color: #333;
  background: #fff;
  font-size: 15px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.market-search-form input::placeholder { color: #999; }
.market-search-form input:focus { border-color: #1e9fff; box-shadow: 0 0 0 2px rgba(30, 159, 255, .12); }
.market-search-btn {
  flex: 0 0 auto;
  height: 46px;
  padding: 0 28px;
  border: 0;
  border-radius: 0 6px 6px 0;
  color: #fff;
  background: #1e9fff;
  font-size: 15px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s;
}
.market-search-btn:hover { background: #0d8de6; }

.market-hotwords { margin: 0 0 10px; text-align: center; }
.market-hotwords .label { margin-right: 6px; color: #999; font-size: 13px; }
.market-hotwords a {
  display: inline-block;
  margin: 3px 4px;
  padding: 3px 10px;
  border-radius: 3px;
  color: #666;
  background: #f5f5f5;
  font-size: 12px;
  transition: all .2s;
}
.market-hotwords a:hover { color: #1e9fff; background: #e8f4ff; }

.market-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 0 0 24px;
  padding: 0 0 20px;
  border-bottom: 1px solid #e6e6e6;
}
.market-tab {
  margin: 4px 2px;
  padding: 8px 18px;
  border-radius: 4px;
  color: #666;
  font-size: 14px;
  transition: all .2s;
}
.market-tab:hover { color: #1e9fff; background: #f0f8ff; }
.market-tab.active { color: #fff; background: #1e9fff; }

.market-sort-dropdown { position: relative; display: inline-block; flex-shrink: 0; margin-left: auto; }
.market-sort-trigger {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 7px 14px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  color: #666;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: all .2s;
}
.market-sort-trigger:hover { border-color: #1e9fff; color: #1e9fff; }
.market-sort-menu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: var(--z-raised);
  display: none;
  min-width: 100px;
  margin-top: 4px;
  border: 1px solid #e6e6e6;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .1);
}
.market-sort-dropdown.open .market-sort-menu { display: block; }
.market-sort-menu a {
  display: block;
  padding: 8px 16px;
  color: #666;
  font-size: 13px;
  white-space: nowrap;
  transition: all .15s;
}
.market-sort-menu a:hover { color: #1e9fff; background: #f0f8ff; }
.market-sort-menu a.active { color: #1e9fff; font-weight: 600; }

.market-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}
.market-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 160px;
  padding: 20px;
  border: 1px solid #e6e6e6;
  border-radius: 6px;
  color: inherit;
  background: #fff;
  transition: box-shadow .25s, transform .25s;
}
.market-card:hover { color: inherit; box-shadow: 0 4px 16px rgba(0, 0, 0, .1); transform: translateY(-2px); }
.market-card-head { display: flex; align-items: center; margin-bottom: 10px; color: inherit; }
.market-card-head:hover { color: inherit; }
.market-card-icon {
  flex: 0 0 40px;
  width: 40px; height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  overflow: hidden;
  border-radius: 8px;
  color: #1e9fff;
  background: #f2f2f2;
  font-size: 20px;
}
.market-card-icon img { width: 100%; height: 100%; object-fit: cover; }
.market-card-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: #333;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.market-card-badge {
  flex: 0 0 auto;
  padding: 1px 6px;
  border-radius: 3px;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.market-card-badge.sync { background: linear-gradient(135deg, #34d399, #0ea968); }
.market-card-badge.async { background: linear-gradient(135deg, #38bdf8, #6366f1); }
.market-card-desc {
  display: -webkit-box;
  min-height: 4.8em;
  margin: 0 0 14px;
  overflow: hidden;
  color: #888;
  font-size: 13px;
  line-height: 1.6;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.market-card-desc:hover { color: #888; }
.market-card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.market-card-price { color: #ff5722; font-size: 14px; font-weight: 600; }
.market-card-price.free { color: #52c41a; }
.market-card-btns { display: flex; gap: 6px; }
.market-card-btn {
  padding: 4px 14px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.6;
  transition: all .2s;
}
.market-card-btn.doc { color: #666; background: #fff; border-color: #d9d9d9; }
.market-card-btn.doc:hover { color: #1e9fff; border-color: #1e9fff; }
.market-card-btn.try { color: #fff; background: #1e9fff; }
.market-card-btn.try:hover { background: #0d8de6; }

.market-empty, .cat-none {
  grid-column: 1 / -1;
  padding: 80px 0;
  border: 1px solid #e6e6e6;
  border-radius: 6px;
  color: #999;
  background: #fff;
  text-align: center;
  font-size: 15px;
}
.market-empty i { display: block; margin-bottom: 12px; color: #d9d9d9; font-size: 48px; }
.market-page { margin: 10px 0 40px; text-align: center; }
.market-page a, .market-page span.active, .market-page span.dots {
  display: inline-block;
  min-width: 36px;
  height: 36px;
  margin: 0 2px;
  padding: 0 8px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  color: #333;
  background: #fff;
  font-size: 14px;
  line-height: 36px;
  text-align: center;
  transition: all .2s;
}
.market-page a:hover { color: #1e9fff; border-color: #1e9fff; background: #f0f8ff; }
.market-page span.active { color: #fff; border-color: #1e9fff; background: #1e9fff; }
.market-page span.dots { min-width: auto; padding: 0 4px; border: 0; color: #999; background: none; cursor: default; }
.market-list-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; padding: 24px 0 16px; }
.market-list-title { margin: 0; padding-left: 12px; border-left: 4px solid #1e9fff; color: #333; font-size: 20px; font-weight: 700; }

/* ==========================================================================
   9. 文档 / 文章 / 表格
   ========================================================================== */

/* —— 全局引用块（tabler.min.css 基础 typography 层） ——
   tabler 原值 --tblr-blockquote-padding: 1rem 四边各撑 16px，正文引用块在窄栏里被
   挤得过窄，改 0.6rem（≈10px）。
   为什么不直接改 tabler.min.css：它是第三方压缩包，已被 .gitignore 排除
   （/public/static/themes/tabler/css/tabler.min.css），deploy.ps1 走 git archive，
   改那份文件不会上线，且下次换版本会丢。theme.css 在 tabler.min.css 之后加载，
   同特异性声明同名变量即可覆盖，计算 padding 时取的就是 .6rem。
   影响面：.markdown / .prose 里的引用块走自己的 --tblr-markdown-blockquote-padding-*，
   不受影响；.neirong 正文块另有字面 padding，也不受影响。 */
blockquote { --tblr-blockquote-padding: 0.6rem; }

/* —— 富文本正文（CMS 详情 / 单页 / 关于我们 / 表单说明 共用） —— */
.neirong { color: var(--ink); font-size: 16px; line-height: 1.9; word-break: break-word; overflow-wrap: anywhere; }
.neirong > :first-child { margin-top: 0; }
.neirong > :last-child { margin-bottom: 0; }
.neirong h1, .neirong h2, .neirong h3, .neirong h4, .neirong h5, .neirong h6 {
  margin: 1.6em 0 0.7em;
  color: var(--ink);
  font-weight: 700;
  line-height: 1.4;
}
.neirong h1 { font-size: 1.55em; }
.neirong h2 { padding-left: 12px; border-left: 4px solid var(--brand); font-size: 1.3em; }
.neirong h3 { font-size: 1.16em; }
.neirong h4 { font-size: 1.06em; }
.neirong h5, .neirong h6 { font-size: 1em; color: var(--muted); }
.neirong p { margin: 0 0 1em; }
.neirong a { color: var(--brand-strong); text-decoration: none; border-bottom: 1px solid var(--brand-line); }
.neirong a:hover { color: var(--brand); border-bottom-color: var(--brand); }
.neirong strong { color: var(--ink); font-weight: 700; }
.neirong ul, .neirong ol { margin: 0 0 1em; padding-left: 1.5em; }
.neirong li { margin: 0.35em 0; }
.neirong blockquote {
  margin: 1.4em 0;
  padding: 14px 20px;
  border-left: 3px solid var(--brand);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--brand-soft);
  color: var(--muted);
  font-size: 0.95em;
}
.neirong blockquote p:last-child { margin-bottom: 0; }
.neirong hr { margin: 2em 0; border: 0; border-top: 1px solid var(--line); }
.neirong pre {
  overflow: auto;
  margin: 1.4em 0;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: #0d1526;
  color: #d7e3f4;
  font: 13px/1.8 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.neirong code {
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background: var(--surface-2);
  color: var(--brand-strong);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.92em;
}
.neirong pre code { padding: 0; background: transparent; color: inherit; font-size: inherit; }
.neirong table { display: block; width: 100%; overflow: auto; margin: 1.4em 0; border-collapse: collapse; font-size: 0.95em; line-height: 1.65; }
.neirong th { padding: 11px 14px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted-2); font-weight: 650; text-align: left; white-space: nowrap; }
.neirong td { padding: 11px 14px; border: 1px solid var(--line); vertical-align: top; }
.neirong tbody tr:nth-child(2n) td { background: var(--surface); }
.neirong img { display: block; max-width: 100%; height: auto; margin: 1.4em 0; border-radius: var(--radius-sm); }
/* editormd.replenish.css 对 .neirong img 写了 max-width:80% !important（正文图片最宽只有容器 80%）且左贴边，
   图片不再居中；手机端在下方媒体查询里取消该宽度上限 */
.neirong iframe, .neirong video { max-width: 100%; }
.neirong figcaption { margin-top: 8px; color: var(--faint); font-size: 0.85em; text-align: center; }
@media (max-width: 768px) {
  .neirong { font-size: var(--text-md); line-height: 1.85; }
  /* 手机端正文图片不受 80% 宽度限制，按可用宽度自适应 */
  body .neirong img { max-width: 100% !important; }
}

/* —— 空状态（全站通用） —— */
.empty-state { padding: 56px 20px; border: 1px dashed var(--line); border-radius: var(--radius-lg); background: var(--card); color: var(--muted-2); text-align: center; }
.empty-state > i { display: block; margin-bottom: 14px; color: var(--faint); font-size: 42px; }
.empty-state p { margin: 0; font-size: var(--text-base); line-height: 1.7; }
.empty-state a { display: inline-flex; align-items: center; gap: 6px; margin-top: 16px; color: var(--brand); font-size: 14px; text-decoration: none; }
.empty-state a:hover { color: var(--brand-strong); }

/* —— 键值信息卡（授权信息 / 配置概览 / 只读详情） —— */
.kv-page { width: min(100% - 32px, 720px); margin: 24px auto 48px; }
.kv-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--card); box-shadow: var(--shadow-xs); }
.kv-card-hd { display: flex; align-items: center; gap: 8px; padding: 16px 20px; border-bottom: 1px solid var(--line); color: var(--ink); font-size: 15px; font-weight: 700; }
.kv-card-hd i { color: var(--brand); font-size: 18px; }
.kv-row { display: flex; align-items: flex-start; gap: 16px; padding: 14px 20px; }
.kv-row + .kv-row { border-top: 1px solid var(--line); }
.kv-key { flex: 0 0 96px; color: var(--muted-2); font-size: var(--text-sm); }
.kv-val { flex: 1; min-width: 0; color: var(--ink); font-size: var(--text-sm); line-height: 1.7; word-break: break-all; }
@media (max-width: 576px) {
  .kv-page { width: calc(100% - 16px); margin: 16px auto 32px; }
  .kv-row { display: block; gap: 0; padding: 12px 16px; }
  .kv-key { margin-bottom: 4px; }
}

.toc-layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 24px; }
.toc-card {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  align-self: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--card);
  box-shadow: var(--shadow-xs);
}
.toc-card a {
  display: block;
  padding: 7px 10px;
  border-radius: var(--radius-xs);
  color: var(--muted-2);
  font-size: 13px;
}
.toc-card a:hover, .toc-card a.active { color: var(--brand); background: var(--brand-soft); }

.doc-header {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 14px 18px;
  margin-bottom: 24px;
}
.doc-info { flex: 1; min-width: 260px; }
.doc-name { margin: 0 0 8px; font-size: clamp(24px, 3vw, 34px); letter-spacing: -.03em; }
.doc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  color: var(--muted-2);
  font-size: 13px;
  line-height: 1.7;
}
.doc-meta > span { margin: 0; }
.doc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.doc-actions .btn { margin: 0; }
.doc-icon {
  width: 56px; height: 56px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  color: var(--brand);
  background: var(--brand-soft);
  font-size: 27px;
}
.doc-panel {
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
}
.doc-section + .doc-section { margin-top: 32px; padding-top: 28px; border-top: 1px solid var(--line); }
.doc-section h2, .doc-section h3 { margin-bottom: 14px; font-weight: 750; }

.doc-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.doc-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 13px;
}
.doc-table th, .doc-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.doc-table th { color: var(--muted-2); background: var(--surface-2); font-weight: 650; white-space: nowrap; }
.doc-table tbody tr:hover td { background: var(--surface); }

.code-block {
  position: relative;
  overflow-x: auto;
  margin: 0;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  color: #d7e3f4;
  background: #0d1526;
  font: 13px/1.8 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  tab-size: 2;
}
.api-value {
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  color: var(--brand-strong);
  background: var(--brand-soft);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: .92em;
  word-break: break-all;
}

.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 288px; gap: 24px; }
.article-content {
  padding: clamp(24px, 4vw, 44px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
}
.article-content h1 { margin: 0 0 14px; font-size: clamp(26px, 4vw, 38px); line-height: 1.26; font-weight: 800; }
.article-content .content, .article-body {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.9;
  overflow-wrap: anywhere;
}
.article-body img, .article-content .content img { height: auto; border-radius: var(--radius-sm); }
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-bottom: 26px;
  color: var(--muted-2);
  font-size: 13px;
}
.article-list { display: grid; gap: 14px; }
.article-item {
  display: grid;
  grid-template-columns: 158px minmax(0, 1fr);
  gap: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
}
.article-item:hover { border-color: var(--brand-line); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.article-item img { width: 158px; height: 104px; border-radius: var(--radius-sm); object-fit: cover; }
.article-item h2 { margin: 0 0 8px; font-size: 18px; }
.article-item p { margin: 0 0 10px; color: var(--muted-2); line-height: 1.7; }

.cat-side { display: grid; gap: 4px; padding: 12px; }
.cat-side a, .cat-side-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  color: var(--muted-2);
  font-size: var(--text-sm);
}
.cat-side a:hover, .cat-side a.active,
.cat-side-item:hover, .cat-side-item.active { color: var(--brand-strong); background: var(--brand-soft); }
.cat-list-hd { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cat-list-name { margin: 0; font-size: 21px; font-weight: 750; }
.cat-list-total, .cat-meta { color: var(--faint); font-size: 12px; }
.cat-meta { display: flex; flex-wrap: wrap; gap: 7px 14px; margin-top: 10px; }

/* 旧的 .table-shell 已删除：它给表格强制 min-width:760px，窄屏只能横向滑动，
   套在 card-body 里还会形成双层边框。键值详情改用 .table.theme-detail-table（随容器自适应），
   数据表用 .card.table-card 卡片壳。 */

/* —— 卡片化表格（theme.js 的 Theme.table.render 输出）——
   结构 + 规格均逐项对齐 PythonCode 会员中心 /member/developer/call-log：
   .card.table-card > .card-header(标题 + 共 N 条) > [筛选 .card-body.border-bottom.py-2] >
   .card-body.p-0 > .table-responsive > table.table.table-vcenter.card-table.table-striped >
   .card-footer.d-flex 分页。
   py 实测值（Tabler 1.4.0 原生，admin.css 零覆盖）：
     .table > :not(caption) > * > *  padding .75rem .75rem → 12px 12px
     .card-table tr td:first-child   padding-left 1.25rem  → 20px
     .card-table tr td:last-child    padding-right 1.25rem → 20px
     .table thead th                 bg-surface-tertiary / 12px / 500 / uppercase /
                                     letter-spacing .04em / line-height 1rem / secondary /
                                     padding-y .5rem(8px) / nowrap
     .table 字号                     继承 body = .875rem(14px)
     .table-striped                  着色行是 nth-of-type(2n)，不是 odd
     --tblr-card-cap-padding         1rem 1.25rem → header/footer 16px 20px
     .card-body.py-2                 padding-block .5rem → 8px 20px */
.table-card { overflow: hidden; }
.table-card > .card-header { gap: 12px; padding: 16px 20px; }
.table-card > .card-header .card-title { margin: 0; color: var(--ink); font-size: 16px; font-weight: 600; }
.table-card > .card-header .card-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.table-card .table-toolbar { margin: 0; }
.table-card .table-toolbar-status { white-space: nowrap; }

/* 筛选条：py 侧是 .card-body.border-bottom.py-2 > form.row.g-2.align-items-end > .col-auto，
   每个字段是 label.form-label.mb-1 + input.form-control-sm / select.form-select-sm。 */
.table-card > .table-filter {
  padding: 8px 20px;
  border-bottom: 1px solid var(--line);
}
.table-card .table-filter .theme-form-toolbar {
  justify-content: flex-start;
  align-items: flex-end;
  gap: 8px;
  margin: 0;
}
.table-card .table-filter .filter-item { display: flex; flex-direction: column; gap: 4px; }
.table-card .table-filter .filter-item > .form-label {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
}
/* py 筛选控件一律用 -sm 尺寸：min-height 32px / padding 5px 8px / 12px / radius 4px */
.table-card .table-filter .filter-item .form-control,
.table-card .table-filter .filter-item .form-select {
  min-height: 32px;
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 16px;
}
.table-card .table-filter .filter-item .form-select { padding-right: 28px; }
.table-card .table-filter .filter-item .form-control { width: 190px; }
.table-card .table-filter .filter-item .form-select { width: 130px; }
/* 筛选按钮与 -sm 档控件同高（32px）：按钮在工具栏里是 .theme-form-toolbar 的直接
   子级，不在 .filter-item 内（旧规则 .filter-item .btn 永远匹配不到，是条死规则）。
   另外只写 min-height 也压不住——基础档 9px 上下内边距 + 20px 行高会把盒子重新顶回
   40px，比 32px 的输入框高出 8px，flex-end 对齐后上半截冒出来。padding / line-height
   必须一并覆盖，三项缺一不可。 */
.table-card .table-filter .theme-form-toolbar > .btn,
.table-card .table-filter .filter-item .btn {
  min-height: 32px;
  padding: 5px 12px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 16px;
}

/* 表格本体：字号 14px（py 继承 body），单元格 12px 上下、首末列 20px */
.table-card .table { min-width: 720px; margin-bottom: 0; font-size: 14px; }
.table-card .table > :not(caption) > * > * {
  padding: 12px;
  border-bottom-color: var(--line);
  vertical-align: middle;
}
.table-card .table > :not(caption) > * > *:first-child { padding-left: 20px; }
.table-card .table > :not(caption) > * > *:last-child { padding-right: 20px; }
/* py .table thead th：浅灰底 + 12px + 500 + 大写 + .04em 字距 + 8px 上下内边距 */
.table-card .table > thead > tr > th {
  padding-top: 8px;
  padding-bottom: 8px;
  color: var(--muted-2);
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .04em;
  line-height: 16px;
  text-transform: uppercase;
  white-space: nowrap;
  border-bottom-color: var(--line);
}
/* py .table-striped 着色的是 nth-of-type(2n)（偶数行），不是奇数行 */
.table-card .table.table-striped > tbody > tr:nth-of-type(2n) > * { --tblr-table-accent-bg: var(--surface-2); }
.table-card .table.table-striped > tbody > tr:nth-of-type(2n+1) > * { --tblr-table-accent-bg: transparent; }
.table-card .table > tbody > tr:hover > * { --tblr-table-accent-bg: var(--brand-soft); }
.table-card .table > tbody > tr:last-child > td { border-bottom: 0; }

/* 卡片底部分页：py 是 .card-footer.d-flex.align-items-center > ul.pagination.m-0.ms-auto，
   全走 Tabler 原生值：gap .25rem(4px)、page-link min-width 2rem(32px)、font-size .875rem(14px)、
   padding calc(.25rem + 1px) .25rem、radius --tblr-border-radius(6px)、active 铺品牌色。 */
.table-card > .card-footer { padding: 16px 20px; }
.table-card .pagination { gap: 4px; justify-content: flex-end; }
.table-card .pagination > li { display: inline-flex; }
.table-card .pagination .page-link {
  min-width: 32px;
  padding: 5px 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  box-shadow: none;
}
.table-card .pagination .page-link:hover {
  border-color: transparent;
  background: var(--surface-2);
  color: var(--brand);
}
.table-card .pagination .page-item.active .page-link {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}
.table-card .pagination .page-item.disabled .page-link {
  border-color: transparent;
  background: transparent;
  color: var(--faint);
}

/* 通用分页（CMS 的 <ul id="pages"> / <ul id="pager"> 与框架分页组件共用） */
#pages, #pager, .pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 26px 0 8px;
  padding: 0;
  list-style: none;
}
#pages > li, #pager > li, .pagination > li { display: inline-flex; }
#pages > li > a, #pages > li > span,
#pager > li > a, #pager > li > span,
.pagination > li > a, .pagination > li > span {
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink);
  font-size: 14px;
  line-height: 1;
}
#pages > li > a:hover, #pager > li > a:hover, .pagination > li > a:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}
#pages > li.active > span, #pager > li.active > span, .pagination > li.active > span {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  font-weight: 600;
}
#pages > li.disabled > span, #pager > li.disabled > span { border-color: transparent; background: transparent; color: var(--faint); }
#pages > li.disabled > span::after, #pager > li.disabled > span::after { content: "…"; }

/* ==========================================================================
   10. 语义布局 / 表单行（历史模板共用）
   ========================================================================== */

/* —— 选项卡：规格对齐 py 侧 attach_config.html 的 .nav.nav-tabs.mb-3 ——
   py: --tblr-nav-link-padding-x/y = .75rem/.5rem → nav-link padding 8px 12px；
       --tblr-nav-link-color = gray-500；.nav-tabs border-bottom 1px；
       .nav-tabs .nav-link margin-bottom -1px、border 1px transparent、顶圆角 6px；
       .nav-tabs .nav-link.active 用 body-color / body-bg / border-color（三边描边），
       不是蓝底胶囊；.mb-3 → margin-bottom 1rem(16px)。
   line-height 必须在这里显式声明：tabler 的 .nav-link 自己没有 line-height，
   文档正文的 .doc-content li{line-height:1.9} 会继承进标签，把 38px 的标签撑到 45px；
   取 --tblr-body-line-height（1.42857 × 14px = 20px）与会员中心其它页面完全等价。 */
.theme-tabs { margin-bottom: 16px; }
.theme-tabs .nav-tabs { gap: 0; border-bottom: 1px solid var(--line); }
.theme-tabs .nav-link {
  margin-bottom: -1px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  color: var(--muted-2);
  font-size: 14px;
  line-height: var(--tblr-body-line-height);
  font-weight: 400;
  background: transparent;
}
.theme-tabs .nav-link:hover { color: var(--brand); border-color: var(--line) var(--line) var(--line); }
.theme-tabs .nav-link.active {
  color: var(--ink);
  background: var(--card);
  border-color: var(--line) var(--line) var(--card);
  box-shadow: none;
}
/* 页签条下划线 → 内容的间距：只给「有 nav-tabs 页签条」的 theme-tabs 加。
   无 nav-tabs 的空壳 theme-tabs 页（getapi/console/* 等）不加——.app-content 已有 24px
   上内边距，再叠 16px 会让卡片上方多出一截冗余空白（2026-12-03 用户以"我的接口"页截图指出）。
   用通用兄弟 ~ 而非 +，兼容 nav 与 tab-content 之间夹有注释/其它元素的页面。 */
.theme-tabs .nav-tabs ~ .tab-content > .tab-pane { padding-top: 16px; }

/* —— 下划线式页签：theme-tabs-underline ——
   视觉真值对齐 py 侧 /doc?page=api_bearer 的语言切换：无边框、无底色、无圆角，
   选中项只靠 2px 品牌色下划线（页签条底部一条 1px 分隔线）。启用五处：
   - 会员中心设置四页（nav 自身就是页签条，服务端跳转）；
   - 收支记录两页；
   - /doc?page=api_bearer|api_sdk 的语言切换（div.theme-tabs > ul.nav-tabs）；
   - /docs/api/{mark} 接口详情与 /skill/{mark} 技能详情（前端切 .tab-pane，白卡壳由页面级
     .doc-tabs-card / .skill-tabs-card 提供，只托住正文与分隔线，不参与页签样式）。
   特异性统一写成 .theme-tabs.theme-tabs-underline（0,2,0 以上），才能压过
   本文件上方 .theme-tabs .nav-link.active 的白底三边描边与 Tabler 的 .nav-tabs 默认胶囊/卡片态。
   margin-bottom 必须为 0，不能沿用卡片变体的 -1px：-1px 是给「选中页签吃掉容器 1px 边框、与内容卡片连成一体」用的，
   下划线变体的 2px 指示线不需要这种合并。保留 -1px 会让 <a> 的盒子比 .nav-tabs 内容盒低 1px；
   /doc?page=api_sdk|api_bearer 为窄屏横向滚动给页签条加了 overflow，这 1px 溢出会被裁掉，
   切换后 2px 下划线只剩一条极细的边、看起来像「没有下划线」（2026-12-04 用户反馈）。
   改为 0 后 2px 下划线完整落在页签条内、紧贴底部分隔线上方，任何缩放/滚动容器都不会裁到它。 */
.theme-tabs.theme-tabs-underline { margin-bottom: 16px; }
.theme-tabs.theme-tabs-underline.nav-tabs,
.theme-tabs.theme-tabs-underline .nav-tabs { gap: 0; border-bottom: 1px solid var(--line); }
.theme-tabs.theme-tabs-underline .nav-link {
  margin-bottom: 0;
  padding: 10px 20px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted-2);
  font-size: 14px;
  font-weight: 500;
  line-height: var(--tblr-body-line-height);
}
.theme-tabs.theme-tabs-underline .nav-link:hover,
.theme-tabs.theme-tabs-underline .nav-link:focus {
  color: var(--brand);
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
}
.theme-tabs.theme-tabs-underline .nav-link.active,
.theme-tabs.theme-tabs-underline .nav-link.active:hover,
.theme-tabs.theme-tabs-underline .nav-link.active:focus {
  color: var(--brand);
  background: transparent;
  border: 0;
  border-bottom: 2px solid var(--brand);
  border-radius: 0;
  box-shadow: none;
}
/* 页签在手机端同一行排不下：收窄左右内边距，仍保持下划线等宽于文字 */
@media (max-width: 575.98px) {
  .theme-tabs.theme-tabs-underline .nav-link { padding: 10px 14px; }
}

/* —— 包裹式页签：theme-tabs-wrap ——
   白卡外壳把页签条与内容整体包住：页签条在壳内顶部横跨整宽（分割线直达壳边），
   内容在壳内继续排。与「标签贴卡片」的区别只在壳层，页签条本身仍是卡片变体。
   启用一处：/member/settings/appkey（前端切 .tab-pane，不是链接式跳转）。
   壳用左右 20px 内边距托住内容，页签条用等量负 margin 反推回壳边（分隔线铺到白卡左右边界），
   但 nav-tabs 自己不能再加 20px 左内边距：那会把第一个页签的边框推进到 20px 处、
   与白卡左边框之间露出一截空白（2026-12-04 用户截图指出）。
   改成页签边框贴壳边、首个页签单独把文字缩进到 20px 与内容对齐，左侧边框透明_
   不与卡片边框叠成 2px 双线。
   壳内的 .card 退化为无边框分组（白卡套白卡只会多出两层描边），
   .card-header 改用 1px 分隔线区分分组并去掉 --surface-2 灰底。 */
.theme-tabs.theme-tabs-wrap {
  margin-bottom: 16px;
  padding: 0 20px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.theme-tabs.theme-tabs-wrap > .nav-tabs {
  margin: 0 -20px;
  padding: 0;
  border-bottom: 1px solid var(--line);
}
.theme-tabs.theme-tabs-wrap > .nav-tabs .nav-link { padding: 10px 16px; }
.theme-tabs.theme-tabs-wrap > .nav-tabs > .nav-item:first-child > .nav-link {
  padding-left: 20px;
  border-left-color: transparent;
}
.theme-tabs.theme-tabs-wrap .tab-content > .tab-pane > .card {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}
.theme-tabs.theme-tabs-wrap .tab-content > .tab-pane > .card > .card-header {
  padding: 0 0 10px;
  border-bottom: 1px solid var(--line);
  background: transparent;
}
.theme-tabs.theme-tabs-wrap .tab-content > .tab-pane > .card > .card-body { padding: 14px 0 0; }
/* 窄屏：壳与页签条的 20px 收成 14px，页签也要相应收窄才排得下三个 */
@media (max-width: 575.98px) {
  .theme-tabs.theme-tabs-wrap { padding: 0 14px 16px; }
  .theme-tabs.theme-tabs-wrap > .nav-tabs { margin: 0 -14px; }
  .theme-tabs.theme-tabs-wrap > .nav-tabs .nav-link { padding: 10px 12px; }
  .theme-tabs.theme-tabs-wrap > .nav-tabs > .nav-item:first-child > .nav-link { padding-left: 14px; }
}

/* —— 表单行：纵向堆叠（label 在上、控件在下）——
   规格逐项对齐 py 侧 /member/developer/attach-config：
   .card > .card-body > div.mb-3 > label.form-label > 控件 > small.form-hint。
   py: .mb-3 = margin-bottom 1rem(16px)；.form-label = 8px/14px/500；
       控件是 .form-control（display:block; width:100%）→ 卡片内满宽，不限 420px。 */
.theme-form-row, .form-row {
  display: block;
  margin-bottom: 16px;
}
.theme-form-row > .form-label,
.theme-form-row > label,
.form-row > label {
  display: block;
  margin-bottom: 8px;
  padding-top: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  text-align: left;
}
.theme-form-row > .form-label:empty,
.theme-form-row > label:empty,
.form-row > label:empty { display: none; }
/* py 的 .form-control 是 width:100%，在 card-body 里直接铺满，无 420/560px 限宽 */
.theme-form-row > .field-control, .form-row > .form-control-wrap { width: 100%; max-width: none; }
.theme-form-row > .theme-form-toolbar { justify-content: flex-start; }
/* 行内直接子级的说明文字（如 appkey 的 IP 白名单提示）：纵向布局后与控件左对齐即可 */
.theme-form-row > .form-text,
.theme-form-row > .form-help {
  box-sizing: border-box;
  max-width: none;
  margin: 0;
  padding-left: 0;
  color: var(--muted-2);
  font-size: var(--text-xs);
  line-height: 1.65;
}
.theme-form-row .btn { margin: 0; }
/* —— 字段自带的动作按钮 ——
   「一个输入框 + 一个确定」（通知设置的手机号/邮箱/预警阈值）和客服页的「一键加群」，历史上写成
   <div class="form-text"> 借用说明文字容器。上面那条 .theme-form-row > .form-text{margin:0} 是给
   纯文字提示准备的（让它贴紧控件），加上 .theme-form-row .btn{margin:0}，两把锁一起落下，
   按钮上沿直接压在输入框下沿上——手机上看到的就是「输入框和确认按钮挤在一起」。
   动作按钮单独用 .field-action：10px 上间距仍小于行与行之间的 16px，字段和它的按钮读作一组。 */
.field-action { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.theme-form-row .field-action { margin-top: 10px; }
/* 字段说明：统一 .form-help（本项目历史用法）与 py/Tabler 原生的 .form-hint
   py 写法是 <small class="form-hint">：color --tblr-secondary(#6b7280)，字号原为 .875em（=12.25px），现已收编到 --text-xs。 */
.form-hint,
.form-text {
  display: block;
  margin-top: 4px;
  color: var(--muted-2);
  font-size: var(--text-xs);
  font-weight: 400;
  line-height: 1.65;
}
/* Tabler 1.7.5 把 .form-help 定义成 1.125rem 的圆形“问号”图标按钮：
   display:inline-flex + 固定 width/height + padding:0 + hover 反色。
   本项目把它当字段说明文字用（账号设置、实名认证等），必须整体还原成块级文本，
   否则宽度被锁死 18px → 中文每行 1 字；高度被锁死 18px → 文字溢出去压住下方按钮。
   Tabler 的 hover / [aria-describedby] 反色同样要压掉，否则鼠标移上去会变成蓝底白字小块。 */
.form-help {
  display: block;
  width: auto;
  height: auto;
  min-width: 0;
  max-width: 100%;
  margin: 6px 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.6;
  text-align: left;
  cursor: auto;
  transition: none;
}
.form-help:hover,
.form-help[aria-describedby] {
  color: var(--muted-2);
  background: none;
}
/* 表单底部操作行：表单行已改成纵向单列，这里不再需要 162px 的 label 列缩进 */
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 22px 0 0; }
.input-with-action { display: flex; gap: 8px; }
.input-with-action > .form-control { flex: 1; min-width: 0; }
/* py .form-check-inline 是 margin-right 1rem(16px) 的行内排列 */
.form-check-list { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.form-label-inline { display: inline-block; margin-right: 8px; font-weight: 500; }

.theme-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 22px;
}
.theme-page-head h1, .theme-page-head h2 { margin: 0 0 6px; font-size: 24px; letter-spacing: -.02em; }
.theme-page-head p { margin: 0; color: var(--muted-2); }
.theme-section { margin-bottom: 20px; }

.theme-notice {
  padding: 14px 16px;
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-md);
  color: var(--brand-strong);
  background: var(--brand-soft);
  font-size: var(--text-sm);
  line-height: 1.7;
}
.theme-notice.warning { color: var(--warning); border-color: var(--warning-line); background: var(--warning-soft); }
.theme-notice.danger { color: var(--danger); border-color: var(--danger-line); background: var(--danger-soft); }

.theme-empty {
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 52px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  color: var(--muted-2);
  background: var(--card);
  text-align: center;
  font-size: 14px;
}
.theme-empty i { color: var(--faint); font-size: 34px; }
.theme-empty p { margin: 0; }

.theme-filterbar {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--card);
}
.theme-filterbar .form-control, .theme-filterbar .form-select { min-width: 160px; }

.theme-upload-picker {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px dashed var(--brand-line);
  border-radius: var(--radius-sm);
  color: var(--brand);
  background: var(--brand-soft);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.theme-upload-picker:hover { border-style: solid; }
.theme-upload-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-preview { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 12px; padding: 0; list-style: none; }
.upload-preview .file-item {
  position: relative;
  width: 94px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
}
.upload-preview img { display: block; width: 100%; height: 74px; border-radius: var(--radius-xs); object-fit: cover; }
.upload-preview button {
  position: absolute;
  top: -6px; right: -6px;
  width: 22px; height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: var(--danger);
}

.table-toolbar-actions, .table-row-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.table-toolbar-status { color: var(--faint); font-size: 12px; }
.table-sort { padding: 0; border: 0; color: inherit; background: transparent; font: inherit; font-weight: inherit; white-space: nowrap; }
.table-sort:hover { color: var(--brand); }
.table-check { width: 42px; text-align: center !important; }
.table-check input { width: 16px; height: 16px; accent-color: var(--brand); }

/* 操作列自适应：Theme.table 会给带 toolbar 的列的 th 与 td 同时打上 .table-col-action。
   width:1% 是表格列「贴内容」的写法，必须配 nowrap：否则 .table-row-actions 这个 flex 容器
   的 min-content 只等于单个按钮宽，列会塌到 72px 让三个按钮竖着堆成一列。同样按钮也要 nowrap，
   所以 td 上的 class 不能省。实测 1746px 容器下操作列 285.9px → 166px，
   让出的空间回到「调用地址」等内容列，不出现横向滚动。 */
.table-col-action { width: 1%; white-space: nowrap; }
.table-col-action .table-row-actions { flex-wrap: nowrap; }
.table-empty { height: 220px; color: var(--muted-2); text-align: center !important; }
.table-empty i { display: block; margin-bottom: 10px; color: var(--faint); font-size: 30px; }
.table-empty strong, .table-empty span { display: block; }
.table-empty span { margin-top: 5px; font-size: 12px; }

/* ==========================================================================
   11. 弹窗 / 通知 / 支付
   ========================================================================== */

.notice-stack {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: var(--z-overlay);
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 36px));
  pointer-events: none;
}
.notification-stack {
  position: fixed;
  right: 18px;
  top: calc(var(--header-h) + 14px);
  z-index: var(--z-overlay);
  display: grid;
  gap: 10px;
  width: min(380px, calc(100vw - 36px));
}
.theme-toast {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--ink);
  background: var(--card);
  box-shadow: var(--shadow-lg);
  font-size: var(--text-sm);
  animation: toast-in 200ms var(--ease);
}
.theme-toast.success { border-left: 4px solid var(--success); }
.theme-toast.error { border-left: 4px solid var(--danger); }
.theme-toast.info { border-left: 4px solid var(--brand); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* —— 弹层：规格逐项对齐 py 会员中心的 Bootstrap/Tabler 原生 .modal ——
   py call_log.html 的详情弹窗结构：
     .modal.modal-blur.fade > .modal-dialog.modal-dialog-centered(max-width:1200px)
       > .modal-content > .modal-header(h5.modal-title + button.btn-close)
                        + .modal-body(max-height:60vh;overflow-y:auto)
                        + .modal-footer(button.btn.btn-secondary)
   py 实测值：--tblr-modal-width 540px；--tblr-modal-border-radius = radius-lg = 8px；
     .modal-header min-height 3.5rem(56px) / padding 0 3.5rem 0 1.5rem → 0 56px 0 24px；
     .modal-title 1rem(16px) / --tblr-font-weight-bold(600) / line-height 1.4286；
     .modal-body padding --tblr-modal-padding = 1.5rem(24px)；
     .modal-footer padding-top/bottom .75rem(12px)、左右 calc(1.5rem - .375rem)=18px。 */
.theme-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-loading);
  display: grid;
  place-items: center;
  padding: 8px;
  background: rgba(15, 23, 42, .5);
  backdrop-filter: blur(4px);
  animation: dialog-fade 160ms ease-out;
}
.theme-dialog {
  display: flex;
  flex-direction: column;
  width: min(540px, calc(100vw - 16px));
  max-height: calc(100vh - 16px);
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow-md);
  animation: dialog-in 200ms var(--ease);
}
.theme-dialog-corner { place-items: end; background: transparent; backdrop-filter: none; pointer-events: none; }
.theme-dialog-corner .theme-dialog { margin: 10px; pointer-events: auto; }
.theme-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 56px;
  padding: 0 56px 0 24px;
  border-bottom: 1px solid var(--line);
  background: transparent;
}
.theme-dialog-header h3 { margin: 0; font-size: 16px; font-weight: 600; line-height: 1.4286; }
.theme-dialog-close {
  position: absolute;
  top: 50%;
  right: 24px;
  margin-top: -16px;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  /* 打开弹层时焦点可能落在关闭按钮上，ghost 按钮的 focus ring 会画出一圈方框；
     关闭按钮对齐 py 的 .btn-close：无边框、无底色、无 ring，只有一个淡 ×。 */
  border: 0;
  background: transparent;
  box-shadow: none;
  /* 状态用颜色表达，不用 opacity：ti-x 是 16px 细笔画图标，整体压到 .4 后在白底上只有
     约 2.5:1（WCAG 非文本控件要求 3:1），静止就看不清；悬浮时底下再垫一层灰，笔画和底色
     一起变淡，看起来反而像「悬浮后更不清楚」。静止给 --muted-2（白底上 4.8:1），
     悬浮同时加深到 --ink 并铺一块实心灰底，两步都能看出来。 */
  color: var(--muted-2);
}
.theme-dialog-close:hover {
  color: var(--ink);
  background: var(--hover-fill);
}
/* 只去掉 focus ring，不强制清底色：键盘 Tab 到关闭按钮时，.btn:focus-visible 会拿到
   与悬浮同一块 --tblr-hover-bg 填充，焦点位置仍然看得见。 */
.theme-dialog-close:focus,
.theme-dialog-close:focus-visible { border: 0; box-shadow: none; outline: none; }
/* 弹层自身也不能带焦点描边：iframe 型弹层（data-open）体内只有 iframe、没有可聚焦元素，
   openDialog 会把焦点落到 section.theme-dialog[tabindex="-1"]；焦点进入内页后 Chromium 又让
   iframe 元素自己匹配 :focus-visible。文件顶部那条全局 :focus-visible 的 2px 品牌蓝描边
   （再外扩 2px）于是沿弹层四周画出一整圈，看上去就是弹层自带一个蓝色边框。
   py 侧 Bootstrap 的 .modal-content 没有这圈描边，焦点提示只留给弹层内部真正的控件。 */
.theme-dialog:focus,
.theme-dialog:focus-visible,
.theme-dialog-frame:focus,
.theme-dialog-frame:focus-visible { outline: none; }
.theme-dialog-header { position: relative; }
/* flex:1 让固定高度的弹层把剩余空间全部给 body，iframe 的 height:100% 才有可解析的确定高度；
   否则 body 高度=内容高度，iframe 塌到 min-height，弹层下半截就是大片空白。 */
.theme-dialog-body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 24px; }
/* iframe 型弹层（data-open）：内容页自带 card-body 内边距，body 不再套一层 padding，
   否则灰底 iframe 四周会露出一圈白边，像框里套框。 */
.theme-dialog-body-frame { padding: 0; overflow: hidden; }
.theme-dialog-frame { display: block; width: 100%; height: 100%; min-height: 120px; border: 0; background: var(--card); }

/* —— 只读详情键值表（py .modal-body 内 .table.table-bordered 的同款形态）——
   键列不换行、弱化颜色；值列允许长串折行；请求参数用 pre 块限高滚动。 */
.theme-detail-table { margin-bottom: 0; }
.theme-detail-table > tbody > tr > th {
  width: 120px;
  color: var(--muted-2);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
  vertical-align: top;
  background: var(--surface-2);
}
.theme-detail-table > tbody > tr > td { font-size: 13px; word-break: break-all; vertical-align: top; }
.theme-detail-table > thead > tr > th { white-space: nowrap; }
.theme-detail-table .table { margin-bottom: 8px; }
.theme-detail-pre {
  margin: 0;
  padding: 8px 10px;
  max-height: 220px;
  overflow: auto;
  border-radius: 4px;
  background: var(--surface-2);
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
}
.theme-confirm p { margin: 0 0 24px; line-height: 1.75; white-space: pre-line; }
/* py .modal-footer：右对齐、上下 12px、有上边框 */
.theme-confirm-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 -24px -24px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
}
.theme-loading {
  position: fixed;
  inset: 0;
  z-index: var(--z-toast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--ink);
  background: rgba(15, 23, 42, .18);
  font-size: 14px;
}
.theme-loading > span:last-child { padding: 10px 16px; border-radius: var(--radius-sm); background: var(--card); box-shadow: var(--shadow-md); }
@keyframes dialog-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }

.message-popup { display: grid; gap: 12px; }
.message-popup-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}
.message-popup-item > strong { display: block; margin-bottom: 7px; font-size: 14px; }
.message-popup-item > p { margin: 0; color: var(--muted-2); font-size: 12px; line-height: 1.65; }
.message-popup-item > footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.message-popup-item time { color: var(--faint); font-size: 11px; }
.msg-popup-wrap { max-height: 320px; overflow: auto; }
.msg-popup-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.msg-popup-item:last-child { border-bottom: 0; }
.msg-popup-title { display: block; margin-bottom: 5px; font-weight: 700; }
.msg-popup-content {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.6;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.msg-popup-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.msg-popup-time { color: var(--faint); font-size: 11px; }

.payment-panel {
  width: min(620px, calc(100% - 32px));
  margin: 48px auto;
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--card);
  box-shadow: var(--shadow-lg);
}
.payment-amount { margin: 16px 0 24px; color: var(--ink); font-size: 40px; font-weight: 800; letter-spacing: -.035em; }
.payment-amount small { font-size: 16px; font-weight: 600; color: var(--muted-2); }
.qr-panel { display: grid; justify-items: center; gap: 12px; padding: 20px; }
.qr-panel img { max-width: 260px; border: 8px solid #fff; border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); }

.theme-form-page { min-height: 100vh; background: var(--surface); }
/* 弹层表单内页（form_head 壳）：宽度跟着弹层走（外层 iframe 宽度 = Theme.dialog 的 area[0]），
   不再硬钉 620px——模板用 data-width="900" 把弹层放宽后，内页仍被锁在 620px
   居中显示，右侧空出一大截。阅读列宽封顶 720px（再宽字段之间就会拉开视线）。
   只有一两个字段的弹层（改密、绑邮箱）用 data-width="520" 把外层一起收窄即可。 */
.theme-dialog-form { width: 100%; max-width: 720px; margin: 0 auto; padding: 26px; }
.theme-dialog-form-head { margin-bottom: 24px; }
.theme-dialog-form-head h1 { margin: 0 0 7px; font-size: 21px; letter-spacing: -.02em; }
.theme-dialog-form-head p { margin: 0; color: var(--muted-2); font-size: 13px; line-height: 1.7; }

/* 悬浮客服条：整体上移 100px、左移 40px，避免压住右侧内容 */
.theme-support {
  position: fixed;
  right: calc(58px + env(safe-area-inset-right));
  bottom: calc(124px + env(safe-area-inset-bottom));
  z-index: var(--z-fixed);
  display: grid;
  gap: 10px;
}
.theme-support-button {
  width: 46px; height: 46px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--brand-line);
  text-decoration: none;
  border-radius: var(--radius-md);
  color: var(--brand);
  background: var(--card);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  font-size: 21px;
  transition: transform var(--transition), color var(--transition), background var(--transition);
}
.theme-support-button:hover { color: #fff; background: var(--brand); transform: translateY(-2px); }

/* —— 全屏加载遮罩（异步批处理：overall/inc/asynchronousloop.html）
   旧 layui 版把这段样式写在模板 <style> 里，迁移到 Tabler 时 <style> 被删、theme.css 却没补，
   遮罩因此退化成「无定位、无底色」的裸 div（$.show() 一开就把页面内容顶下去）。
   这里用 .overlay 作用域收口：既补回遮罩视觉，也避开 Tabler 自带的 .progress-bar。
   开合由 .is-open 控制，不用 jQuery 的 show()/hide()——jQuery 会把 display 推导成 block。 */
.overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-loading);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  color: #fff;
  background: rgba(15, 23, 42, .62);
}
.overlay.is-open { display: flex; }
.overlay .loading-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.overlay .loading-icon img { border-radius: 50%; }
.overlay .loading-icon p { margin: 0; }
.overlay .progress-info {
  width: min(360px, 92vw);
  padding: 16px 18px;
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, .12);
  text-align: center;
}
.overlay .progress-bar {
  height: 8px;
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, .2);
}
.overlay .progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
  transition: width .3s ease;
}
.overlay .progress-fill.is-complete { background: var(--success); }
.overlay .progress-text {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.6;
}

/* ==========================================================================
   12. 页脚（深色，与营销页 hero 呼应）
   ========================================================================== */

.site-footer {
  margin-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  background: linear-gradient(160deg, #0f172a, #111d33 60%, #0b1220);
  color: #94a3b8;
}
.site-footer-inner {
  width: min(var(--container), calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  font-size: 13px;
}
.site-footer a { color: #94a3b8; }
.site-footer a:hover { color: #fff; }
.site-footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }

/* ==========================================================================
   13. 移动端
   ========================================================================== */

/* --------------------------------------------------------------------------
   手机端外壳：结构与小导航/深色 Header/下拉菜单/页脚数值，
   直接对齐 PythonCode app/templates/cms/wap/base.html
   -------------------------------------------------------------------------- */
.wap-topbar { display: flex; align-items: center; justify-content: space-between; padding: 8px 15px; border-bottom: 1px solid #f0f0f0; background: #fafafa; color: #999; font-size: 12px; }
.wap-topbar a { color: #666; }
.wap-topbar a:hover { color: #2563eb; }
.wap-topbar .sep { margin: 0 6px; color: #ddd; }
.wap-topbar .search-link i { margin-right: 2px; color: #ff5722; font-size: 12px; }

.wap-header {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 15px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: #fff;
}
.wap-header .brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.wap-header .brand img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.wap-header .brand i { color: #ffd700; font-size: 20px; }
/* 手机端站标图标与 PC 同款：金橙圆角方块 + ti-api（不再用 fa-database） */
.wap-header .brand .site-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 6px;
  color: #0f172a;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  box-shadow: 0 2px 6px rgba(245, 158, 11, .35);
  font-size: 13px;
}
.wap-header .brand .site-brand-mark i { color: inherit; font-size: inherit; }
.wap-header .brand span { overflow: hidden; color: #ffd700; font-size: 17px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.wap-header .menu-btn { padding: 5px; color: #fff; font-size: 22px; cursor: pointer; }

.wap-nav { display: none; padding: 10px 0; background: #1e293b; }
.wap-nav.open { display: block; }
.wap-nav a { display: block; padding: 12px 20px; border-bottom: 1px solid rgba(255, 255, 255, .06); color: rgba(255, 255, 255, .85); font-size: 15px; }
.wap-nav a:hover, .wap-nav a.active { color: #ffd700; background: rgba(255, 255, 255, .05); }

/* 手机端内容包裹层（overall/wap/header.html 的 <main>，桌面端不渲染）。
   边距口径不压在这里——改由全站共用的 .page-shell 统一提供（见上方 @media），
   这样 doc / formguide 等未走 wap 漏斗、没有 .wap-content 的页面也能一致。 */
.wap-content { width: 100%; min-height: calc(100vh - 104px); margin: 0; padding: 0; }

.wap-footer { padding: 20px 15px; background: #273037; color: #999; font-size: 12px; line-height: 2; text-align: center; }
.wap-footer p { margin: 0; }
.wap-footer a { color: #999; }
.wap-footer a:hover { color: #fff; }

/* ==========================================================================
   14. 响应式
   ========================================================================== */

@media (max-width: 1200px) {
  .market-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .site-search { width: min(220px, 20vw); }
  .site-header-inner { gap: 12px; }
  .site-brand { font-size: 22px; letter-spacing: 1.5px; }
  .site-brand img, .site-brand-mark { width: 42px; height: 42px; font-size: 21px; }
  .site-nav > a, .site-nav-group > a { padding: 0 13px; font-size: var(--text-base); }
}

@media (max-width: 992px) {
  .site-search { display: none; }
  .market-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-layout { grid-template-columns: minmax(0, 1fr); }
  .article-layout > aside { grid-row: 1; }
  .toc-layout { grid-template-columns: 1fr; }
  .toc-card { position: static; }
  .app-content { padding: 20px 20px 36px; }
  .member-header-inner { padding-inline: 20px; }
  .site-brand { font-size: 18px; letter-spacing: 1px; }
  .site-brand img, .site-brand-mark { width: 40px; height: 40px; font-size: 20px; }
  .site-nav > a, .site-nav-group > a { padding: 0 12px; font-size: 14px; }
  .site-actions .btn-login, .site-actions .btn-login-ghost { height: 36px; padding: 0 14px; font-size: 13px; }
}

@media (max-width: 768px) {
  :root { --header-h: 56px; }

  .site-header-inner { width: calc(100% - 24px); min-height: var(--header-h); gap: 10px; }
  .site-brand { font-size: 16px; letter-spacing: .5px; gap: 8px; }
  .site-brand img, .site-brand-mark { width: 34px; height: 34px; font-size: 18px; }
  .site-nav { display: none; }
  .site-actions { margin-left: auto; gap: 8px; }
  .nav-toggle { display: inline-grid; place-items: center; }

  .nav-drawer {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    z-index: var(--z-popover);
    display: block;
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
    padding: 12px 16px calc(20px + env(safe-area-inset-bottom));
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    box-shadow: 0 18px 40px rgba(15, 23, 42, .35);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: transform var(--transition), opacity var(--transition), visibility var(--transition);
  }
  .nav-drawer.open { transform: none; opacity: 1; visibility: visible; }
  .nav-drawer .site-search { display: block; width: 100%; margin-bottom: 12px; }
  .nav-drawer a {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, .85);
    font-size: 15px;
    font-weight: 600;
  }
  .nav-drawer a:hover, .nav-drawer a.active { color: #fff; background: rgba(255, 255, 255, .12); }
  .nav-drawer .nav-drawer-group-title {
    margin: 12px 0 4px;
    padding: 0 12px;
    color: rgba(255, 255, 255, .45);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
  }
  .nav-drawer .nav-drawer-sub { padding-left: 30px; font-size: 14px; font-weight: 500; color: rgba(255, 255, 255, .65); }
  .nav-drawer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .1); }
  .nav-drawer-actions .btn-outline-primary { color: #fff; border-color: rgba(255, 255, 255, .35); }
  .nav-drawer-actions .btn-primary {
    color: #0f172a;
    border-color: transparent;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    font-weight: 700;
  }

  .page-container, .page-container-narrow { width: calc(100% - 28px); padding: 22px 0 90px; }

  /* 手机端侧栏回到抽屉形态：取消桌面的左让位（padding-left）与顶条缩进（margin-left） */
  .app-shell { display: block; width: 100%; padding-left: 0; }
  .member-header { margin-left: 0; }
  .app-sidebar {
    position: fixed;
    top: var(--header-h);
    bottom: auto;
    left: 0;
    z-index: var(--z-popover);
    width: 272px;
    height: calc(100vh - var(--header-h));
    transform: translateX(-100%);
    transition: transform var(--transition);
    box-shadow: var(--shadow-lg);
  }
  .app-shell.sidebar-open .app-sidebar { transform: none; }
  .app-shell.sidebar-open::after {
    content: "";
    position: fixed;
    inset: var(--header-h) 0 0;
    z-index: var(--z-dialog);
    background: rgba(15, 23, 42, .42);
  }
  /* 手机端左右收到 10px（桌面仍为 24px），上下 16px / 底部 24px（原 88px 是给已移除的底部悬浮条让位） */
  .app-content { padding: 16px 10px 24px; }

  .member-header-inner { width: 100%; padding-inline: 0; gap: 12px; }
  .member-topnav { display: none; }
  /* 顶部品牌已移除：左侧只留汉堡，【消息】【头像】用 margin-left:auto 靠右 */
  .member-header-actions { margin-left: auto; }
  .member-header .member-nav-toggle { width: 46px; height: 46px; border-radius: 10px; font-size: 22px; }

  .auth-page { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-panel { padding: 32px 20px; }

  .market-grid { grid-template-columns: 1fr; }
  .market-hero { padding: 28px 20px; border-radius: var(--radius-lg); }
  .market-search-form { max-width: 100%; }
  .market-sort-dropdown { margin-left: 0; }
  .market-card-foot { align-items: flex-start; flex-direction: column; gap: 10px; }
  .market-card-btns { width: 100%; }
  .market-card-btn { flex: 1; text-align: center; }

  .article-item { grid-template-columns: 1fr; }
  .article-item img { width: 100%; height: 180px; }
  .article-content { padding: 22px 18px; }

  .doc-header { gap: 12px; }
  .doc-actions { width: 100%; margin-left: 0; }
  .doc-actions .btn { flex: 1; }
  .doc-icon { width: 48px; height: 48px; font-size: 23px; }

  .site-footer-inner { width: calc(100% - 28px); flex-direction: column; align-items: flex-start; gap: 14px; padding: 28px 0; }
  .site-footer-links { gap: 12px 16px; }

  /* 手机端略左移，避开内容右边缘；bottom 沿用基础的 124px（原 132px 是为已移除的底部条让位） */
  .theme-support { right: calc(26px + env(safe-area-inset-right)); }
  /* .wap-content 底部留白已并入 .page-shell 统一口径 */

  /* 表单行在 768 断点保持纵向 block：label 的 flex-basis 与提示文字的 102px 左缩进
     都是横向布局时代的对齐补偿，纵向布局下只会让提示文字和提交按钮整体右移，
     已随 theme-form-row 改 block 一起移除（560 以下的归零规则保留作兜底）。 */
  .theme-dialog-corner .theme-dialog { width: calc(100vw - 24px); }
}

@media (max-width: 560px) {
  body { font-size: var(--text-base); }

  .site-header-inner { width: calc(100% - 20px); }
  .site-brand { font-size: 16px; }
  .site-brand img { width: 30px; height: 30px; }
  .site-brand-mark { width: 30px; height: 30px; font-size: 17px; }
  .site-actions .btn-label { display: none; }
  .site-actions .btn { min-height: 34px; padding: 5px 11px; }

  .page-title { font-size: 24px; }
  .page-container, .page-container-narrow { width: calc(100% - 24px); }
  .card-body { padding: 18px 16px; }
  .card-header { padding: 14px 16px; }
  .stat-value { font-size: 25px; }

  .market-hero { padding: 24px 16px; }
  .market-hero h1 { font-size: 26px; }
  .market-hero-tags { flex-direction: column; gap: 8px; }
  .market-card { padding: 18px 16px; }
  .market-tabs { gap: 6px; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 12px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .market-tabs::-webkit-scrollbar { display: none; }
  .market-tab { flex: 0 0 auto; }

  .theme-form-row, .form-row { display: block; }
  .theme-form-row > .form-label, .theme-form-row > label, .form-row > label {
    display: block;
    padding: 0 0 7px;
    text-align: left;
  }
  .theme-form-row > .field-control, .form-row > .form-control-wrap { max-width: none; }
  .theme-form-row > .form-text, .theme-form-row > .form-help { padding-left: 0; }
  .form-actions { margin-left: 0; }

  .auth-standalone { padding: 28px 14px; }
  .auth-site { margin-bottom: 18px; font-size: 22px; }
  .auth-standalone .auth-card { padding: 24px 18px; }
  .table-toolbar { align-items: flex-start; flex-direction: column; }
  .theme-page-head { align-items: flex-start; }
  .input-action { flex-direction: column; }
  .input-action > .btn { width: 100%; }

  .auth-card .input-action { flex-direction: column; }
  .auth-card .input-action > .btn { width: 100%; }

  .payment-amount { font-size: 32px; }
  .doc-table { min-width: 640px; }
  .article-content { padding: 20px 16px; }
}

/* ==========================================================================
   15. Py 外壳桥接（复用 py/common.css 后的必要补充）
   --------------------------------------------------------------------------
   PythonCode 的 common.css 已直接复用，负责 .top-bar / .header / .navlist / .copy；
   这里只补 PhpCode 模板特有的差异（移动端搜索、品牌名截断、子菜单宽度等）。
   ========================================================================== */

/* .copy 的底色 / 行高 / 字号 / 链接色由 py/common.css 统一提供（含 ≤576px 的居中）；
   这里只保留 PhpCode 模板特有的排版，不再重复声明同一批属性——重复声明等于把 py 的取值
   锁死在本文件里，改 py 一边不生效。 */
.copy .w1200 { text-align: center; }
.copy .sep { margin: 0 8px; color: #555; }

.header .logo .brand-name {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 站标前图标：PC 与手机端统一走金橙圆角方块 + ti-api（API 语义最贴切）。
   旧版 PC 是 48px 大方块，偏大；收到 32px 与 26px 站名匹配，手机端 24px 见 .wap-header 段 */
.header .logo .site-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 8px;
  color: #0f172a;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  box-shadow: 0 3px 10px rgba(245, 158, 11, .35);
  font-size: 17px;
  line-height: 1;
}
@media (max-width: 992px) {
  .header .logo .site-brand-mark { width: 28px; height: 28px; font-size: 15px; }
}
.header .nav ul .subnav { width: auto; min-width: 100%; }
.header .nav ul .subnav a { white-space: nowrap; }
.header .nav li a { white-space: nowrap; }
.header .nav { min-width: 0; }
.header .nav li a .ti-chevron-down { margin-left: 4px; font-size: 12px; }

/* py/common.css 把 ul/ol 的 list-style 全局归零，正文内容区需要把项目符号补回来。
   容器必须用 :where() 包一层（零特异性）：本项目 tabler.min.css 并没有全局归零 ul/ol，
   这条规则对正文而言只是重复 UA 默认值；写成 .doc-content ul 反而拿到 (0,1,1)，压过
   组件自带的复位（tabler .nav{list-style:none}、doc.css .doc-steps{list-style:none} 都是
   (0,1,0)），于是 /doc?page=api_sdk、api_bearer 的语言切换选项卡被画成一排带圆点的列表，
   ul/ol.doc-steps 也会在序号圆点之外多出一个数字 marker。 */
:where(.neirong, .doc-content, .article-body, .article-content .content) ul { list-style: disc outside; }
:where(.neirong, .doc-content, .article-body, .article-content .content) ol { list-style: decimal outside; }

/* 桌面端搜索入口在上方 top-bar，抽屉内的搜索框只在移动面板出现 */
.nav-search { display: none; }

@media (max-width: 768px) {
  .nav-search { display: block; padding: 0 20px 10px; }
  .nav-search input {
    width: 100%;
    height: 38px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 8px;
    color: #fff;
    background: rgba(255, 255, 255, .08);
    font-size: 14px;
    outline: none;
  }
  .nav-search input::placeholder { color: rgba(255, 255, 255, .5); }
  .nav-search input:focus { border-color: #fbbf24; }
  /* 导航面板展开时锁住背景滚动 */
  body.nav-open { overflow: hidden; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
