/* ==================================================
   推客小程序控制台 · 视觉沿用原 SaaS 后台
   深色侧栏 #0f172a / 渐变顶栏 / 蓝 #3b82f6 高亮 / 内容区 #f1f5f9
   ================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
[v-cloak] { display: none; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', sans-serif;
  background: #f1f5f9;
  color: #0f172a;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: 56px; z-index: 1000;
  background: linear-gradient(90deg, #0f172a, #1e293b);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; box-shadow: 0 1px 4px rgba(15, 23, 42, .3);
}
.tb-left { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; color: #fff; }
.tb-left i { color: #93c5fd; font-size: 20px; }
.tb-left .dot { width: 6px; height: 6px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 6px #22c55e; margin-left: 2px; }

.tb-switch { display: flex; align-items: center; gap: 8px; }
.switch-btn {
  display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 9px; color: #fff; font-size: 13.5px; cursor: pointer; transition: .18s;
}
.switch-btn:hover { background: rgba(255, 255, 255, .17); }
.switch-btn i { font-size: 15px; color: #93c5fd; }
.switch-btn .arrow { font-size: 12px; color: #94a3b8; margin-left: 2px; }
.switch-ic { width: 20px; height: 20px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; color: #fff; }

.tb-right { display: flex; align-items: center; gap: 14px; }
.tb-user { display: flex; align-items: center; gap: 7px; font-size: 13.5px; color: #e2e8f0; }
.tb-avatar { width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, #3b82f6, #6366f1); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; }
.tb-btn { padding: 7px 16px; background: #ef4444; color: #fff; border: none; border-radius: 8px; font-size: 13px; cursor: pointer; transition: .18s; }
.tb-btn:hover { background: #dc2626; }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; padding-top: 56px; }

.sidebar {
  width: 220px; background: #0f172a; color: #fff; flex-shrink: 0;
  position: fixed; top: 56px; bottom: 0; left: 0; overflow-y: auto;
  padding: 16px 0 24px;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: #1e293b; border-radius: 4px; }

.side-app {
  margin: 0 14px 16px; padding: 14px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(59, 130, 246, .18), rgba(99, 102, 241, .1));
  border: 1px solid rgba(147, 197, 253, .18);
}
.side-app .sa-top { display: flex; align-items: center; gap: 10px; }
.side-app .sa-ic { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 17px; color: #fff; }
.side-app .sa-name { font-size: 14.5px; font-weight: 700; color: #fff; line-height: 1.3; }
.side-app .sa-sub { font-size: 11px; color: #94a3b8; margin-top: 2px; }
.side-app .sa-meta { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.pill { font-size: 10.5px; padding: 2px 7px; border-radius: 6px; background: rgba(148, 163, 184, .18); color: #cbd5e1; }
.pill.on { background: rgba(34, 197, 94, .16); color: #4ade80; }
.pill.dev { background: rgba(245, 158, 11, .16); color: #fbbf24; }

.menu-group-title { font-size: 12px; color: #64748b; padding: 10px 20px 6px; display: flex; align-items: center; gap: 6px; }
.menu-group-title i { font-size: 12px; }
.menu-item {
  padding: 11px 20px; cursor: pointer; display: flex; align-items: center; gap: 8px;
  font-size: 14px; color: #cbd5e1; border-left: 3px solid transparent; transition: .15s;
}
.menu-item i { font-size: 16px; color: #64748b; transition: .15s; }
.menu-item:hover { background: #1e293b; color: #fff; }
.menu-item:hover i { color: #93c5fd; }
.menu-item.active { background: #3b82f6; color: #fff; border-left-color: #93c5fd; }
.menu-item.active i { color: #fff; }
.menu-item .badge { margin-left: auto; font-size: 10.5px; background: rgba(239, 68, 68, .9); color: #fff; border-radius: 8px; padding: 1px 6px; }
.menu-item.active .badge { background: rgba(255, 255, 255, .25); }

.back-top { margin: 12px 14px 0; padding: 9px; border-radius: 9px; text-align: center; font-size: 12.5px; color: #94a3b8; background: rgba(148, 163, 184, .1); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; }
.back-top:hover { background: rgba(148, 163, 184, .18); color: #fff; }

.content { margin-left: 220px; flex: 1; padding: 20px 22px 40px; min-width: 0; }

/* ---------- 页面通用 ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 21px; font-weight: 800; letter-spacing: -.3px; display: flex; align-items: center; gap: 9px; }
.page-head h1 i { color: #3b82f6; font-size: 21px; }
.page-head .sub { font-size: 12.5px; color: #64748b; margin-top: 5px; }
.head-actions { display: flex; gap: 10px; }

.card { background: #fff; border-radius: 12px; padding: 24px; box-shadow: 0 1px 3px rgba(0, 0, 0, .05); margin-bottom: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-head h3 { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.card-head h3 i { color: #3b82f6; font-size: 16px; }

/* 统计卡 */
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
@media (max-width: 1180px) { .stat-cards { grid-template-columns: repeat(2, 1fr); } }
.stat-card { border-radius: 12px; padding: 20px 22px; color: #fff; position: relative; overflow: hidden; }
.stat-card::after { content: ''; position: absolute; right: -14px; top: -14px; width: 70px; height: 70px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.stat-card .sc-label { font-size: 12.5px; opacity: .85; display: flex; align-items: center; gap: 6px; }
.stat-card .sc-label i { font-size: 15px; }
.stat-card .sc-value { font-size: 28px; font-weight: 800; letter-spacing: -.5px; margin: 8px 0 4px; line-height: 1.1; }
.stat-card .sc-foot { font-size: 11.5px; opacity: .8; display: flex; align-items: center; gap: 4px; }
.g-blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.g-green { background: linear-gradient(135deg, #10b981, #059669); }
.g-orange { background: linear-gradient(135deg, #f59e0b, #ea580c); }
.g-violet { background: linear-gradient(135deg, #7c5cff, #5f37d6); }

/* 应用卡片列表（总览） */
.app-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 20px; }
@media (max-width: 1280px) { .app-cards { grid-template-columns: repeat(2, 1fr); } }
.app-card {
  background: #fff; border-radius: 12px; padding: 18px; box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
  cursor: pointer; transition: .18s; position: relative; overflow: hidden;
}
.app-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(15, 23, 42, .1); }
.app-card .ac-top { display: flex; align-items: center; gap: 11px; }
.app-card .ac-ic { width: 42px; height: 42px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 20px; color: #fff; flex: none; }
.app-card .ac-name { font-size: 15px; font-weight: 700; }
.app-card .ac-appid { font-size: 10.5px; color: #94a3b8; margin-top: 3px; font-family: ui-monospace, Menlo, monospace; }
.app-card .ac-mid { display: flex; gap: 18px; margin: 16px 0 12px; }
.app-card .ac-kpi .v { font-size: 19px; font-weight: 800; letter-spacing: -.3px; }
.app-card .ac-kpi .l { font-size: 10.5px; color: #94a3b8; margin-top: 2px; }
.app-card .ac-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px solid #f1f5f9; }
.app-card .ac-foot .go { font-size: 12.5px; color: #3b82f6; font-weight: 600; display: flex; align-items: center; gap: 4px; }
.mini-trend { display: flex; align-items: flex-end; gap: 3px; height: 22px; }
.mini-trend i { width: 5px; background: linear-gradient(180deg, #93c5fd, #3b82f6); border-radius: 2px; display: block; }

/* 状态标签 */
.tag { font-size: 11px; padding: 2px 8px; border-radius: 6px; display: inline-flex; align-items: center; gap: 4px; }
.tag.on { background: #ecfdf5; color: #059669; }
.tag.dev { background: #fffbeb; color: #d97706; }
.tag.gray { background: #f1f5f9; color: #64748b; }
.tag.red { background: #fef2f2; color: #dc2626; }
.tag.blue { background: #eff6ff; color: #2563eb; }

/* 表格微调 */
.el-table { --el-table-border-color: #f1f5f9; --el-table-header-bg-color: #f8fafc; font-size: 13px; }
.el-table th.el-table__cell { font-weight: 600; color: #475569; }
.el-table .cell { line-height: 1.7; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: #64748b; }
.money-out { color: #ef4444; font-weight: 600; }
.money-in { color: #10b981; font-weight: 600; }
.empty { padding: 44px 0; text-align: center; color: #94a3b8; font-size: 13px; }
.empty i { font-size: 34px; display: block; margin-bottom: 10px; color: #cbd5e1; }

/* 趋势图 */
.trend-wrap { padding: 6px 4px 0; }
.trend-svg { width: 100%; height: auto; display: block; }

/* 密钥库 */
.key-row { display: flex; align-items: center; gap: 14px; padding: 15px 0; border-bottom: 1px solid #f1f5f9; }
.key-row:last-child { border-bottom: none; }
.key-row .kr-ic { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 17px; color: #fff; flex: none; }
.key-row .kr-name { font-size: 14px; font-weight: 600; }
.key-row .kr-appid { font-size: 11.5px; color: #94a3b8; font-family: ui-monospace, Menlo, monospace; margin-top: 2px; }
.key-row .kr-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* 登录页 */
.login-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 15% -10%, #1e293b 0%, #0f172a 55%, #0b1220 100%);
  position: relative; overflow: hidden;
}
.login-body::before { content: ''; position: absolute; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle, rgba(59, 130, 246, .28), transparent 65%); top: -180px; right: -120px; }
.login-body::after { content: ''; position: absolute; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(124, 92, 255, .22), transparent 65%); bottom: -160px; left: -100px; }
.login-card {
  width: 388px; background: rgba(255, 255, 255, .98); border-radius: 18px; padding: 38px 36px 32px;
  box-shadow: 0 24px 60px rgba(2, 6, 23, .45); position: relative; z-index: 2;
}
.login-logo { display: flex; align-items: center; gap: 11px; margin-bottom: 26px; }
.login-logo .lg-ic { width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg, #3b82f6, #6366f1); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 22px; box-shadow: 0 8px 18px rgba(59, 130, 246, .35); }
.login-logo .lg-t { font-size: 19px; font-weight: 800; letter-spacing: -.4px; }
.login-logo .lg-s { font-size: 11.5px; color: #94a3b8; margin-top: 1px; }
.login-form .el-form-item { margin-bottom: 18px; }
.login-card .el-input__wrapper { border-radius: 10px; padding: 6px 14px; box-shadow: 0 0 0 1px #e2e8f0 inset; }
.login-card .el-input__wrapper.is-focus { box-shadow: 0 0 0 1px #3b82f6 inset; }
.login-btn { width: 100%; height: 44px; color: #fff; border-radius: 10px; font-size: 15px; font-weight: 600; letter-spacing: .5px; background: linear-gradient(135deg, #3b82f6, #2563eb); border: none; box-shadow: 0 8px 18px rgba(37, 99, 235, .28); }
.login-tip { margin-top: 18px; font-size: 11.5px; color: #94a3b8; text-align: center; line-height: 1.8; }
.login-foot { position: absolute; bottom: 22px; left: 0; right: 0; text-align: center; font-size: 11.5px; color: #475569; z-index: 2; }

/* 顶栏选项卡 */
.tb-tabs { flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px; padding: 0 12px; overflow: hidden; }
.tb-tab {
  display: flex; align-items: center; gap: 7px; height: 36px; padding: 0 14px;
  border-radius: 9px; font-size: 13.5px; color: #94a3b8; cursor: pointer;
  transition: .16s; white-space: nowrap; user-select: none;
}
.tb-tab:hover { color: #e2e8f0; background: rgba(255, 255, 255, .07); }
.tb-tab.active { color: #fff; background: rgba(59, 130, 246, .2); box-shadow: inset 0 -2px 0 #3b82f6; }
.tb-tab.active i { color: #93c5fd; }
.tb-tab .tab-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.tb-tab.active .tab-dot { box-shadow: 0 0 8px currentColor; }
.tb-tab i { font-size: 15px; }

/* 应用切换下拉（保留） */
.tb-switch { position: relative; }
.switch-mask { position: fixed; inset: 0; z-index: 1; }
.switch-menu {
  position: absolute; top: 44px; left: 0; width: 244px; z-index: 3;
  background: #fff; border-radius: 12px; padding: 8px;
  box-shadow: 0 18px 46px rgba(2, 6, 23, .32); border: 1px solid #eef1f6;
}
.sm-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; cursor: pointer; font-size: 13.5px; color: #0f172a; transition: .15s; }
.sm-item:hover { background: #f1f5f9; }
.sm-item.active { background: #eff6ff; color: #2563eb; font-weight: 600; }
.sm-item .sm-name { flex: 1; }
.sm-item .sm-check { color: #2563eb; font-size: 15px; }
.sm-divider { height: 1px; background: #f1f5f9; margin: 6px 4px; }
.sm-item .switch-ic { width: 24px; height: 24px; border-radius: 7px; }
.switch-ic i { font-size: 13px; }

/* 弹窗 */
.el-dialog { border-radius: 14px; }
.dlg-row { display: flex; padding: 9px 0; border-bottom: 1px dashed #f1f5f9; font-size: 13px; }
.dlg-row .k { width: 92px; color: #94a3b8; flex: none; }
