/* ============================================================
   必租开放平台 — 统一设计系统 (Design Tokens + Components)
   前台 Portal 与 后台 Console 共用同一套设计语言
   ============================================================ */

:root {
  /* 品牌色 */
  --c-primary: #4f46e5;
  --c-primary-d: #4338ca;
  --c-primary-l: #6366f1;
  --c-blue: #2563eb;
  --c-teal: #0ea5a4;
  --c-cyan: #06b6d4;

  /* 语义色 */
  --c-success: #10b981;
  --c-success-bg: #ecfdf5;
  --c-warning: #f59e0b;
  --c-warning-bg: #fffbeb;
  --c-danger: #f97316;
  --c-danger-bg: #fff7ed;
  --c-info: #3b82f6;
  --c-info-bg: #eff6ff;

  /* 中性色 */
  --c-ink: #0f172a;
  --c-ink-2: #334155;
  --c-ink-3: #64748b;
  --c-ink-4: #94a3b8;
  --c-line: #e2e8f0;
  --c-line-2: #eef2f7;
  --c-bg: #f6f8fc;
  --c-surface: #ffffff;

  /* 渐变 */
  --grad-brand: linear-gradient(135deg, #4f46e5 0%, #2563eb 100%);
  --grad-hero: radial-gradient(1200px 600px at 80% -10%, rgba(99,102,241,0.18), transparent 60%),
               radial-gradient(900px 500px at 0% 10%, rgba(14,165,164,0.14), transparent 55%),
               linear-gradient(180deg, #0b1437 0%, #0f1f4d 100%);

  /* 间距 / 圆角 / 阴影 */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-full: 999px;

  --sh-sm: 0 1px 2px rgba(15,23,42,0.06), 0 1px 3px rgba(15,23,42,0.05);
  --sh-md: 0 4px 12px rgba(15,23,42,0.08);
  --sh-lg: 0 12px 32px rgba(15,23,42,0.12);
  --sh-brand: 0 10px 30px rgba(79,70,229,0.28);

  /* 字体 */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  --maxw: 1200px;
  --header-h: 64px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--c-ink);
  background: var(--c-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--c-primary); text-decoration: none; }
img { max-width: 100%; }
button { font-family: inherit; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }

/* ---------- 布局容器 ---------- */
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.container.wide { max-width: 1320px; }
.section { padding: 72px 0; }
.section.tight { padding: 48px 0; }
.section-head { text-align: center; margin-bottom: 40px; }
.section-head .eyebrow {
  display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: 1px;
  color: var(--c-primary); background: var(--c-info-bg);
  padding: 4px 12px; border-radius: var(--r-full); margin-bottom: 14px;
}
.section-head h2 { font-size: 32px; margin: 0 0 10px; letter-spacing: -0.5px; }
.section-head p { color: var(--c-ink-3); margin: 0 auto; max-width: 620px; font-size: 16px; }
.grid { display: grid; gap: 22px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: var(--r-md);
  padding: 11px 20px; font-size: 15px; font-weight: 600; cursor: pointer;
  transition: all .18s ease; white-space: nowrap; line-height: 1;
}
.btn-primary { background: var(--grad-brand); color: #fff; box-shadow: var(--sh-brand); }
.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn-ghost { background: #fff; color: var(--c-ink); border-color: var(--c-line); }
.btn-ghost:hover { border-color: var(--c-primary); color: var(--c-primary); }
.btn-light { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.3); }
.btn-light:hover { background: rgba(255,255,255,.24); }
.btn-sm { padding: 7px 13px; font-size: 13px; border-radius: var(--r-sm); }
.btn-xs { padding: 3px 8px; font-size: 11.5px; border-radius: var(--r-sm); }
.btn-danger { background: var(--c-danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.05); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* ---------- 徽章 / 标签 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: var(--r-full); line-height: 1.6;
}
.badge.free { background: #ecfdf5; color: #047857; }
.badge.paid { background: #fffbeb; color: #b45309; }
.badge.beta { background: #eef2ff; color: #4338ca; }
.badge.online { background: #ecfdf5; color: #059669; }
.badge.offline { background: #fff7ed; color: #ea580c; }
.badge.info { background: #eff6ff; color: #2563eb; }
.badge.warn { background: #fffbeb; color: #d97706; }
.badge.ok { background: #ecfdf5; color: #059669; }
.tag {
  display: inline-block; font-size: 12px; color: var(--c-ink-3);
  background: var(--c-line-2); border-radius: var(--r-sm); padding: 2px 9px; margin: 2px 4px 2px 0;
}
.tag-xs { font-size: 11.5px; padding: 1px 7px; border-radius: 10px; white-space: nowrap; }
}
.method { font-family: var(--font-mono); font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 6px; }
.method.get { background: #e0f2fe; color: #0369a1; }
.method.post { background: #dcfce7; color: #15803d; }
.method.put { background: #fef3c7; color: #b45309; }
.method.delete { background: #fff7ed; color: #c2410c; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--c-surface); border: 1px solid var(--c-line);
  border-radius: var(--r-lg); padding: 22px; box-shadow: var(--sh-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card.hover:hover { transform: translateY(-4px); box-shadow: var(--sh-lg); border-color: #c7d2fe; }

/* ---------- 图标（内联 SVG） ---------- */
.ic { width: 22px; height: 22px; flex: none; }
.ic-lg { width: 40px; height: 40px; }
.icon-box {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 13px; background: var(--c-info-bg); color: var(--c-primary);
}
.icon-box.teal { background: #ccfbf1; color: #0f766e; }
.icon-box.amber { background: var(--c-warning-bg); color: #b45309; }
.icon-box.green { background: var(--c-success-bg); color: #047857; }

/* ============================================================
   前台 PORTAL 专用
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: rgba(255,255,255,.82); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--c-line);
}
.site-header .inner { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; color: var(--c-ink); }
.brand .logo {
  width: 34px; height: 34px; border-radius: 10px; background: var(--grad-brand);
  display: grid; place-items: center; color: #fff; font-weight: 900;
}
.nav { display: flex; gap: 6px; align-items: center; }
.nav a {
  color: var(--c-ink-2); font-weight: 600; font-size: 15px; padding: 8px 14px; border-radius: var(--r-sm);
}
.nav a:hover, .nav a.active { color: var(--c-primary); background: var(--c-info-bg); }
.nav .btn { margin-left: 8px; }
.menu-toggle { display: none; }

.hero {
  position: relative; color: #fff; padding: 96px 0 110px;
  background: var(--grad-hero); overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 48px 48px; mask-image: radial-gradient(circle at 70% 30%, #000, transparent 70%);
}
.hero .inner { position: relative; z-index: 1; max-width: 820px; }
.hero h1 { font-size: 52px; line-height: 1.1; margin: 18px 0 18px; letter-spacing: -1px; }
.hero p.sub { font-size: 19px; color: rgba(255,255,255,.82); margin: 0 0 30px; }
.hero .cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 44px; margin-top: 52px; flex-wrap: wrap; }
.hero-stats .stat .n { font-size: 30px; font-weight: 800; }
.hero-stats .stat .l { color: rgba(255,255,255,.7); font-size: 14px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
  padding: 6px 14px; border-radius: var(--r-full);
}

/* 分类筛选 */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-bottom: 36px; }
.chip {
  border: 1px solid var(--c-line); background: #fff; color: var(--c-ink-2);
  padding: 9px 18px; border-radius: var(--r-full); font-weight: 600; font-size: 14px; cursor: pointer;
  transition: all .15s ease;
}
.chip:hover { border-color: var(--c-primary); color: var(--c-primary); }
.chip.active { background: var(--grad-brand); color: #fff; border-color: transparent; box-shadow: var(--sh-brand); }

/* 服务卡片 */
.svc-card { display: flex; flex-direction: column; gap: 12px; height: 100%; }
.svc-card .top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.svc-card h3 { margin: 0; font-size: 18px; }
.svc-card .desc { color: var(--c-ink-3); font-size: 14px; flex: 1; }
.svc-card .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.svc-cat { font-size: 12px; color: var(--c-ink-4); display: flex; align-items: center; gap: 5px; }

/* API 文档卡片 */
.doc-card { font-family: var(--font-mono); }
.doc-card .endpoint { display: flex; align-items: center; gap: 10px; }
.doc-card .path { color: var(--c-ink); font-size: 14px; word-break: break-all; }
.doc-card .desc { font-family: var(--font); color: var(--c-ink-3); font-size: 14px; margin-top: 8px; }
.doc-card .params { font-family: var(--font); margin-top: 12px; border-top: 1px dashed var(--c-line); padding-top: 12px; }
.doc-card .param { display: flex; gap: 8px; font-size: 13px; padding: 3px 0; }
.doc-card .param .pn { font-family: var(--font-mono); color: var(--c-primary); font-weight: 600; }
.doc-card .param .pt { color: var(--c-ink-4); }
.doc-card pre {
  font-family: var(--font-mono); font-size: 12.5px; background: #0f172a; color: #e2e8f0;
  padding: 12px; border-radius: var(--r-sm); overflow-x: auto; margin-top: 12px;
}

/* 资源 / 案例 / 公告 */
.res-card { display: flex; gap: 14px; align-items: flex-start; }
.res-card h4 { margin: 0 0 4px; font-size: 16px; }
.res-card p { margin: 0; color: var(--c-ink-3); font-size: 13.5px; }
.case-card .quote { font-size: 16px; color: var(--c-ink-2); font-style: italic; margin: 14px 0; position: relative; padding-left: 18px; }
.case-card .quote::before { content: "“"; position: absolute; left: -2px; top: -10px; font-size: 40px; color: #c7d2fe; }
.case-logo { width: 48px; height: 48px; border-radius: 12px; background: var(--grad-brand); color: #fff; display: grid; place-items: center; font-weight: 800; }
.notice {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-md);
  border: 1px solid var(--c-line); background: #fff; margin-bottom: 12px;
}
.notice .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 8px; flex: none; }
.notice.info .dot { background: var(--c-info); }
.notice.warning .dot { background: var(--c-warning); }
.notice.success .dot { background: var(--c-success); }
.notice .t { font-weight: 700; font-size: 14.5px; }
.notice .c { color: var(--c-ink-3); font-size: 13.5px; }
.notice .date { color: var(--c-ink-4); font-size: 12px; }

.footer {
  background: #0b1437; color: rgba(255,255,255,.7); padding: 56px 0 30px; margin-top: 40px;
}
.footer a { color: rgba(255,255,255,.8); }
.footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; }
.footer h5 { color: #fff; font-size: 15px; margin: 0 0 14px; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: 9px; font-size: 14px; }
.footer .bottom { border-top: 1px solid rgba(255,255,255,.12); margin-top: 36px; padding-top: 20px; font-size: 13px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* ============================================================
   后台 CONSOLE 专用
   ============================================================ */
.console { display: flex; min-height: 100vh; background: var(--c-bg); }
.sidebar {
  width: 240px; flex: none; background: #0f172a; color: #cbd5e1;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
  overflow-y: auto;
}
.sidebar .brand {
  color: #fff; padding: 20px 20px 16px; border-bottom: 1px solid rgba(255,255,255,.08);
  font-size: 15px; font-weight: 700; letter-spacing: 0.3px; display: flex; align-items: center; gap: 10px;
}
.sidebar .brand .logo { width: 30px; height: 30px; font-size: 15px; }

/* ── 扁平导航（admin 风格） ── */
.side-nav { padding: 8px 10px; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.side-nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border-radius: var(--r-sm); color: #94a3b8; font-size: 13.5px;
  font-weight: 500; transition: all .15s ease; position: relative;
  text-decoration: none; line-height: 1;
}
.side-nav a .nav-icon {
  width: 18px; height: 18px; flex-shrink: 0; opacity: .7;
  display: inline-flex; align-items: center; justify-content: center;
}
.side-nav a .nav-icon svg { width: 18px; height: 18px; }
.side-nav a:hover { background: rgba(255,255,255,.06); color: #e2e8f0; }
.side-nav a:hover .nav-icon { opacity: 1; }
.side-nav a.active {
  background: rgba(79,70,229,.14); color: #a5b4fc; font-weight: 600;
}
.side-nav a.active .nav-icon { opacity: 1; color: #818cf8; }
.side-nav a.active::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; background: #6366f1; border-radius: 0 3px 3px 0;
}

.sidebar .foot { padding: 10px 14px; border-top: 1px solid rgba(255,255,255,.08); font-size: 11px; color: var(--c-ink-3); line-height: 1.6; display: flex; align-items: center; gap: 4px; }
.sidebar .foot .ic { width: 14px; height: 14px; vertical-align: -2px; flex-shrink: 0; }
.sidebar .foot a { color: var(--c-ink-3); text-decoration: none; display: inline-flex; align-items: center; gap: 3px; transition: color .15s; }
.sidebar .foot a:hover { color: var(--c-primary); }
.sidebar .foot .sep { color: rgba(255,255,255,.2); margin: 0 2px; }

/* ── 二级导航 tabs（内容区顶部，对齐 Element Plus el-tabs） ── */
.sub-nav-tabs {
  display: flex; gap: 0;
  background: #fff; padding: 0 26px;
  border-bottom: 1px solid var(--c-line);
  min-height: 41px;
}
.sub-nav-tabs a {
  display: inline-flex; align-items: center; padding: 12px 18px;
  font-size: 13.5px; font-weight: 500; color: #334155;
  text-decoration: none; position: relative; transition: color .15s;
  line-height: 1; white-space: nowrap; border-bottom: 2px solid transparent;
}
.sub-nav-tabs a:hover { color: var(--c-primary); }
.sub-nav-tabs a.active {
  color: var(--c-primary); font-weight: 600; border-bottom-color: var(--c-primary);
}

.console-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 62px; background: #fff; border-bottom: 1px solid var(--c-line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 26px; position: sticky; top: 0; z-index: 20;
}
.topbar > div:first-child { min-width: 0; flex: 1; overflow: hidden; }
.topbar h1 { font-size: 18px; margin: 0; white-space: nowrap; }
.topbar .crumb { color: var(--c-ink-4); font-size: 13px; margin-bottom: 2px; }
.topbar .right { display: flex; align-items: center; gap: 12px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--grad-brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.console-body { padding: 26px; flex: 1; }

/* 数据表格 */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .left { display: flex; gap: 10px; align-items: center; flex-wrap: nowrap; }
.search {
  border: 1px solid var(--c-line); border-radius: var(--r-md); padding: 9px 13px; font-size: 14px; min-width: 140px; max-width: 260px; flex: 1; outline: none;
}
.search:focus { border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
.table-wrap { background: #fff; border: 1px solid var(--c-line); border-radius: var(--r-lg); overflow: visible; box-shadow: var(--sh-sm); }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th {
  text-align: left; padding: 10px 14px; background: #f0f4ff; color: #4338ca;
  font-weight: 600; font-size: 12.5px; border-bottom: 2px solid var(--c-line); white-space: nowrap;
  letter-spacing: 0.02em;
}
table.data th:first-child { width: 42px; text-align: center; }
table.data td:first-child { width: 42px; text-align: center; color: var(--c-ink-4); font-size: 12.5px; }
table.data th.sortable { cursor: pointer; user-select: none; }
table.data th.sortable:hover { background: #e8edff; }
table.data td { padding: 10px 14px; border-bottom: 1px solid var(--c-line-2); vertical-align: middle; word-break: break-word; color: var(--c-ink); }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: #fafbff; }
.expand-row td { padding: 0 !important; background: #f8fafc; vertical-align: top; }
.db-tables-panel { padding: 16px 20px; }
.db-tables-head { display:flex; align-items:center; gap:10px; margin-bottom:12px; font-size:14px; }
.db-tables-head b { font-size:14px; color:var(--c-ink-2); }
table.data.data-sm th, table.data.data-sm td { padding: 8px 12px; font-size:13px; }
table.data.data-sm code { font-size:12px; }
.cell-title { font-weight: 600; color: var(--c-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; display: inline-block; vertical-align: middle; }
.cell-sub { color: var(--c-ink-4); font-size: 12.5px; }
.row-actions { display: inline-flex; gap: 6px; align-items: center; justify-content: flex-start; }
/* 操作按钮：图标风格，语义化配色 */
.row-actions .btn-ghost.btn-sm { width: 30px; height: 30px; padding: 0; display:inline-flex;align-items:center;justify-content:center;border-radius:7px; }
.row-actions .btn-ghost.btn-sm svg { width:15px;height:15px; }
.row-actions .act-edit:hover { background: #eef2ff; color: #4338ca; }
.row-actions .act-refresh:hover { background: #fff7ed; color: #d97706; }
.row-actions .act-del:hover { background: #fff7ed; color: #ea580c; }
.row-actions .act-toggle:hover { background: #f0fdf4; color: #16a34a; }
/* 分页 */
.pagination { background: #fcfdff; }
.pagination select { height: 32px; font-size: 13px; padding: 0 6px; border-radius: 6px; min-width: auto; max-width: 90px; }
.pagination input[type="number"] { width: 48px; height: 32px; text-align: center; border: 1px solid var(--c-line); border-radius: 6px; font-size: 13px; outline: none; }
.pagination input[type="number"]:focus { border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(79,70,229,.1); }
/* 空数据 */
.empty { padding: 48px 24px; text-align: center; color: var(--c-text-3); }
.empty div { margin-top: 12px; font-size: 14px; }

/* 表单 / 弹窗 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15,23,42,.5); backdrop-filter: blur(2px);
  display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 100; overflow-y: auto;
}
.modal {
  background: #fff; border-radius: var(--r-xl); width: 100%; max-width: 560px; box-shadow: var(--sh-lg);
  animation: pop .18s ease;
}
@keyframes pop { from { transform: translateY(12px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { padding: 20px 24px; border-bottom: 1px solid var(--c-line); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3 { margin: 0; font-size: 18px; }
.modal-body { padding: 22px 24px; max-height: 64vh; overflow-y: auto; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--c-line); display: flex; justify-content: flex-end; gap: 10px; }
.close-x { border: none; background: none; font-size: 22px; cursor: pointer; color: var(--c-ink-4); line-height: 1; }

.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 6px; color: var(--c-ink-2); }
.field .hint { font-size: 12px; color: var(--c-ink-4); margin-top: 4px; }

/* 权限 / 多选勾选框（按分类分组，一级可全选） */
.checks { display: flex; flex-direction: column; gap: 0; padding: 2px 0; }
.check-group { padding: 6px 0; }
.check-group + .check-group { border-top: 1px solid var(--c-line); margin-top: 2px; }
.check-group-row { display: flex; align-items: center; gap: 7px; cursor: pointer; padding: 3px 2px 6px; user-select: none; }
.check-group-row:hover { opacity: .8; }
.check-group-row input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--c-primary); flex: 0 0 auto; cursor: pointer; }
.check-group-title { font-size: 13px; font-weight: 700; color: var(--c-ink-2); }
.check-group-count { font-size: 11px; color: var(--c-ink-4); background: var(--c-bg); padding: 1px 7px; border-radius: 10px; }
.check-item { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border: 1px solid var(--c-line); border-radius: 20px; cursor: pointer; background: #fff; transition: border-color .15s, background .15s; font-size: 13px; line-height: 1.3; user-select: none; margin: 2px 4px 2px 0; }
.check-item:hover { border-color: var(--c-primary); background: #f8f7ff; }
.check-item input[type=checkbox] { width: 14px; height: 14px; accent-color: var(--c-primary); flex: 0 0 auto; }
.check-name { font-weight: 500; font-size: 13px; color: var(--c-ink-2); }
.check-key, .check-desc { display: none; }
/* 密钥权限模式：全部权限 / 受限 分段切换 */
.checks-perm { padding: 2px 0; }
.seg { display: inline-flex; gap: 4px; padding: 3px; background: #f1f3f9; border-radius: 9px; margin-bottom: 10px; }
.seg-btn {
  border: none; background: transparent; color: var(--c-ink-3); font-size: 13px; font-weight: 600;
  padding: 6px 14px; border-radius: 7px; cursor: pointer; transition: all .15s; font-family: inherit;
}
.seg-btn:hover:not(:disabled) { color: var(--c-primary); }
.seg-btn.active { background: #fff; color: var(--c-primary); box-shadow: 0 1px 3px rgba(15,23,42,.12); }
.seg-btn:disabled { opacity: .45; cursor: not-allowed; }
.perm-all-note {
  display: flex; align-items: center; gap: 8px; padding: 12px 14px; margin: 4px 0;
  background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: 9px; color: #047857; font-size: 13px; line-height: 1.5;
}
.perm-all-icon { font-size: 15px; }
.input, .textarea, .select {
  width: 100%; border: 1px solid var(--c-line); border-radius: var(--r-md); padding: 10px 13px;
  font-size: 14px; font-family: inherit; outline: none; background: #fff; color: var(--c-ink);
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
.textarea { resize: vertical; min-height: 84px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* 租户 Logo 上传控件 */
.logo-upload { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.logo-preview { width: 56px; height: 56px; border-radius: 10px; object-fit: contain; border: 1px solid var(--c-line); background: #fff; padding: 3px; flex: 0 0 auto; }
.logo-actions { display: flex; flex-direction: column; gap: 6px; }
.logo-actions input[type=file] { font-size: 12.5px; color: var(--c-ink-3); }

/* 提示 / 空态 */
.toast {
  position: fixed; top: 22px; left: 50%; transform: translateX(-50%); z-index: 200;
  background: #0f172a; color: #fff; padding: 12px 22px; border-radius: var(--r-full); font-size: 14px;
  box-shadow: var(--sh-lg); animation: pop .2s ease;
}
.empty { text-align: center; padding: 60px 20px; color: var(--c-ink-4); }
.empty .ic { width: 48px; height: 48px; opacity: .5; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 26px; }
.stat-card { background: #fff; border: 1px solid var(--c-line); border-radius: var(--r-lg); padding: 18px 20px; box-shadow: var(--sh-sm); }
.stat-card .n { font-size: 28px; font-weight: 800; color: var(--c-primary); }
.stat-card .l { color: var(--c-ink-3); font-size: 13px; margin-top: 2px; }

/* 租户内容统计小卡片（紧凑门户概览版） */
.portal-stats { display: flex; gap: 0; border: 1px solid var(--c-line-2); border-radius: var(--r-md); background: var(--c-surface); overflow: hidden; margin-bottom: 14px; }
.ps-item { flex: 1; text-align: center; padding: 10px 6px; border-right: 1px solid var(--c-line-2); }
.ps-item:last-child { border-right: none; }
.ps-n { display: block; font-size: 20px; font-weight: 700; color: var(--c-primary); line-height: 1.2; }
.ps-l { font-size: 11px; color: var(--c-ink-4); margin-top: 2px; }

/* 门户租户列表（紧凑行） */
.portal-tenants { display: flex; flex-direction: column; gap: 8px; }
.pt-row { background: var(--c-surface); border: 1px solid var(--c-line-2); border-radius: var(--r-md); padding: 10px 14px; transition: box-shadow .15s; }
.pt-row:hover { box-shadow: var(--sh-sm); }
.pt-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.pt-name { font-size: 13.5px; color: var(--c-ink-1); }
.pt-code { font-size: 11.5px; color: var(--c-ink-4); background: var(--c-line-1); padding: 1px 7px; border-radius: 4px; font-family: var(--font-mono); }
.pt-manage { margin-left: auto !important; padding: 3px 8px !important; font-size: 11.5px; }

.pt-stats { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--c-ink-3); flex-wrap: wrap; }
.pt-stats span i { font-weight: 600; color: var(--c-primary); font-style: normal; margin-right: 2px; }
.pt-total { margin-left: auto; color: var(--c-ink-4); font-style: normal; font-size: 11px; }

.pt-recent { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.pt-tag { font-size: 11px; color: var(--c-ink-3); background: #f1f5f9; padding: 2px 8px; border-radius: 4px; white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis; cursor: default; border: 1px solid #e2e8f0; line-height: 1.6; display: inline-flex; align-items: center; }
.pt-tag b { font-weight: 600; margin-right: 4px; }
.pt-t-A { color: #818cf8; } /* API */
.pt-t-分 { color: #f59e0b; } /* 分类 */
.pt-t-文 { color: #06b6d4; } /* 文档 */
.pt-t-资 { color: #10b981; } /* 资源 */
.pt-t-案 { color: #ec4899; } /* 案例 */
.pt-t-公 { color: #f97316; } /* 公告 */

.token-box {
  display: flex; align-items: center; gap: 10px; background: #0f172a; color: #e2e8f0;
  padding: 12px 16px; border-radius: var(--r-md); font-family: var(--font-mono); font-size: 13px;
}

/* 控制台登录 */
.console-login { min-height: 100vh; display: grid; place-items: center; background: var(--grad-hero); padding: 20px; }
.login-card { background: #fff; border-radius: var(--r-xl); padding: 38px; width: 100%; max-width: 400px; box-shadow: var(--sh-lg); }
.login-card h2 { margin: 0 0 6px; }
.login-card p.sub { color: var(--c-ink-3); margin: 0 0 22px; font-size: 14px; }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1024px) {
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .footer .cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .nav { display: none; }
  .nav.open {
    display: flex; flex-direction: column; position: absolute; top: var(--header-h); left: 0; right: 0;
    background: #fff; padding: 14px; border-bottom: 1px solid var(--c-line); gap: 4px; box-shadow: var(--sh-md);
  }
  .menu-toggle { display: inline-flex; }
  .hero { padding: 64px 0 80px; }
  .hero h1 { font-size: 36px; }
  .hero-stats { gap: 28px; }
  .section { padding: 52px 0; }
  .section-head h2 { font-size: 26px; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 60; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--sh-lg); }
  .sidebar.open { transform: none; }
  .console-main { width: 100%; }
  .side-toggle { display: inline-flex !important; }
  .table-wrap { overflow-x: auto; }
  table.data { min-width: 680px; }
  .field-row { grid-template-columns: 1fr; }
  .footer .cols { grid-template-columns: 1fr; }
}
.side-toggle { display: none; }

/* ============================================================
   自定义面板（开发工具 / 认证管理）
   ============================================================ */
.subtabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.subtab {
  border: 1px solid var(--c-line); background: #fff; color: var(--c-ink-2);
  padding: 8px 16px; border-radius: var(--r-full); font-weight: 600; font-size: 13.5px; cursor: pointer;
  transition: all .15s ease;
}
.subtab:hover { border-color: var(--c-primary); color: var(--c-primary); }
.subtab.active { background: var(--grad-brand); color: #fff; border-color: transparent; box-shadow: var(--sh-brand); }

.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.kv > div { display: flex; flex-direction: column; gap: 2px; }
.kv span { font-size: 12px; color: var(--c-ink-4); }
.kv b { font-size: 14px; color: var(--c-ink); }

.proxy-result {
  font-family: var(--font-mono); font-size: 12.5px; background: #0f172a; color: #e2e8f0;
  padding: 14px; border-radius: var(--r-md); overflow-x: auto; margin-top: 12px; max-height: 320px;
}

/* ── 企微配置诊断：API 覆盖矩阵 ── */
.cov-module { border-top: 1px solid var(--c-line); }
.cov-module:first-of-type { border-top: none; }
.cov-head { display: flex; align-items: center; gap: 10px; padding: 13px 6px; cursor: pointer; user-select: none; }
.cov-head:hover { background: rgba(79,70,229,.04); }
.cov-toggle { color: var(--c-primary); display: inline-flex; }
.cov-head b { color: var(--c-ink); font-size: 14.5px; }
.cov-head .cell-sub { flex: 1; }
.cov-count { margin-left: auto; }
.cov-apis { padding: 4px 6px 12px 30px; display: flex; flex-direction: column; gap: 6px; }
.cov-api { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--c-line); border-radius: var(--r-md); cursor: pointer; background: #fff; transition: border-color .15s, box-shadow .15s; }
.cov-api:hover { border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(79,70,229,.1); }
.cov-name { font-weight: 600; color: var(--c-ink); font-size: 13.5px; }
.cov-path { font-family: var(--font-mono); font-size: 12px; color: var(--c-ink-4); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* HTTP 方法徽标配色 */
.method.get { background: #eef2ff; color: #4338ca; }
.method.post { background: #ecfdf5; color: #047857; }
.method.put { background: #fffbeb; color: #b45309; }
.method.delete { background: #fef2f2; color: #b91c1c; }
.method.patch { background: #f5f3ff; color: #6d28d9; }

/* 可排序表头 */
.col-head.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.col-head.sortable:hover { background: var(--c-line-2); }
.col-head.sortable .col-label { margin-right: 2px; }
.sort-ind { display: inline-block; margin-left: 4px; font-size: 10px; color: var(--c-info); vertical-align: middle; }

/* 单元格：强调主文本 */
.cell-strong { font-weight: 700; color: var(--c-ink); font-size: 14px; line-height: 1.3; }

/* ════════════════════════════════════
   控制台仪表盘 (Dashboard)
   ════════════════════════════════════ */
.dash-welcome {
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(135deg, #1a3a6b 0%, #2d5a9e 100%);
  color: #fff; border-radius: 10px; padding: 22px 24px;
  margin-bottom: 20px;
}
.dash-welcome h2 { color: #fff; }
.dash-welcome p { color: rgba(255,255,255,.7); }
.dash-welcome-actions { display: flex; gap: 8px; flex-shrink: 0; }
.dash-welcome-actions .btn-primary { background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.25); }
.dash-welcome-actions .btn-primary:hover { background: rgba(255,255,255,.25); }

.quick-tile {
  display: flex; align-items: center; gap: 8px; padding: 14px 16px;
  background: var(--c-surface); border: 1px solid var(--c-line-2);
  border-radius: 8px; text-decoration: none; color: var(--c-ink-1);
  font-size: 13.5px; font-weight: 500; transition: all .15s;
}
.quick-tile:hover { border-color: var(--c-info); color: var(--c-info); transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,.06); }

.dash-overview { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.dash-item { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--c-line-2); font-size: 13px; }
.dash-item:last-child { border-bottom: none; }
.dash-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dash-dot.info { background: var(--c-info); } .dash-dot.success { background: #22c55e; }
.dash-dot.beta { background: #f59e0b; } .dash-dot.warning { background: #f97316; }
.dash-dot.online { background: #22c55e; } .dash-dot.danger { background: #f97316; }
.dash-label { color: var(--c-ink-3); flex: 1; }

/* ════════════════════════════════════
   个人中心 (Profile)
   ════════════════════════════════════ */
.profile-header { display: flex; align-items: center; gap: 18px; padding: 8px 0; }
.avatar-lg { width: 56px; height: 56px; line-height: 56px; text-align: center;
  border-radius: 14px; background: linear-gradient(135deg,#E87722,#1a3a6b);
  color: #fff; font-size: 22px; font-weight: 700; flex-shrink: 0; }
.profile-info h3 { font-size: 17px; }
.profile-info p { margin: 2px 0 !important; }

/* ════════════════════════════════════
   消息中心 (Messages)
   ════════════════════════════════════ */
.msg-list { display: flex; flex-direction: column; gap: 10px; }
.msg-item { display: flex; gap: 12px; padding: 14px 16px; background: var(--c-surface);
  border: 1px solid var(--c-line-2); border-radius: 8px; cursor: pointer;
  transition: background .2s, border-color .2s, opacity .3s; }
.msg-item:hover { background: var(--c-line-1); }
.msg-item.unread { border-left: 3px solid var(--c-info); background: #eff6ff; }
.msg-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c-primary);
  flex-shrink: 0; margin-top: 6px; transition: opacity .25s, transform .25s; }
.msg-body { flex: 1; min-width: 0; }
.msg-title { font-size: 14px; font-weight: 600; color: var(--c-ink-1); margin-bottom: 3px; transition: opacity .2s; }
.msg-item:not(.unread) .msg-title { font-weight: 500; color: var(--c-ink-2); }
.msg-item:not(.unread) .msg-desc { color: var(--c-ink-4); }
.msg-desc { font-size: 12.5px; color: var(--c-ink-3); line-height: 1.6; margin-bottom: 5px; }
.msg-meta { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--c-ink-4); }

/* Header avatar link */
.avatar-link { text-decoration: none; cursor: pointer; display: inline-flex; align-items: center; }

/* ════════════════════════════════════
   密钥管理：紧凑表格专用样式
   ════════════════════════════════════ */

/* 密钥名称 + 租户（两行合并列） */
.key-name-cell { line-height: 1.45; min-width: 0; }
.key-name-cell .cell-strong { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.key-name-cell .cell-sub { display: block; font-size: 12px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }

/* App Key 截断显示 */
.key-mono { font-family: var(--font-mono); font-size: 12.5px; background: var(--c-line-2); padding: 3px 8px; border-radius: 6px; cursor: default; display: inline-block; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.key-mono:hover { background: #e2e8f0; }

/* 权限紧凑标签 */
.tag-xs { font-size: 11px !important; padding: 1px 7px !important; margin: 1px 3px 1px 0 !important; border-radius: 4px !important; }

/* IP 限制图标 */
.ip-lock { font-size: 11px; cursor: help; opacity: .7; margin-left: 2px; }
.ip-lock:hover { opacity: 1; }

/* 调用次数 + 日限额（进度条可视化） */
.usage-cell { min-width: 100px; }
.usage-num { font-size: 13px; font-weight: 600; color: var(--c-ink); }
.usage-bar { width: 100%; height: 5px; background: var(--c-line-2); border-radius: 3px; margin-top: 4px; overflow: hidden; }
.usage-fill { height: 100%; border-radius: 3px; transition: width .3s ease; }
