/* ==================================================================
   框架层：深色可折叠侧栏 + 多页签 + 统一列表页模板
   结构与视觉对齐真实系统（天鼎数字-商品平台）
   本文件在 styles.css 之后加载，用于覆盖基础样式
   ================================================================== */
:root {
  --nav-bg: linear-gradient(180deg, #1f2d3d 0%, #24313f 100%);
  --nav-text: #cbd5e1;
  --nav-mute: #8ea0b5;
  --dc: #409eff;
}

/* ---------- 侧边栏 ---------- */
.sidebar {
  width: 212px;
  background: var(--nav-bg);
  border-right: none;
  transition: width .2s ease;
}
.sidebar.collapsed { width: 56px; }
.sidebar-brand {
  height: 50px;
  padding: 0 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  cursor: pointer;
}
.sidebar-brand .mark {
  width: 26px; height: 26px; border-radius: 6px;
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
  font-size: 13px;
}
.sidebar-brand .name { color: #fff; font-size: 13.5px; font-weight: 600; line-height: 1.2; }
.sidebar-brand .name small { color: rgba(255, 255, 255, .42); font-size: 9px; letter-spacing: 2px; }
.sidebar-scroll { padding: 6px 0 14px; }
.sidebar-scroll::-webkit-scrollbar { width: 4px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .14); border-radius: 4px; }

.menu-group { padding: 0; }
.menu-group-title {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; color: var(--nav-mute);
  font-size: 12.5px; cursor: pointer; user-select: none;
}
.menu-group-title:hover { color: #e2e8f0; }
.menu-group-title .g-icon { font-size: 14px; }
.menu-group-title .arrow { margin-left: auto; font-size: 11px; transition: transform .18s ease; opacity: .6; }
.menu-group-title .arrow.open { transform: rotate(90deg); }
.menu-group-body { padding-bottom: 4px; }

.menu-item {
  margin: 1px 8px; padding: 8px 10px; border-radius: 5px;
  color: var(--nav-text); font-size: 13px; gap: 9px;
}
.menu-item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.menu-item.active { background: var(--dc); color: #fff; font-weight: 500; }
.menu-item .el-icon { font-size: 15px; }
.menu-item.icon-only { justify-content: center; margin: 2px 9px; padding: 9px 0; }
.sidebar-foot { border-top: 1px solid rgba(255, 255, 255, .07); color: rgba(255, 255, 255, .28); padding: 9px 14px; font-size: 10.5px; }

/* ---------- 顶栏 ---------- */
.header { height: 50px; padding: 0 14px; gap: 12px; }
.header .toggle { color: #4b5563; font-size: 17px; padding: 4px; border-radius: 4px; }
.header .toggle:hover { background: #f2f6fc; color: var(--dc); }
.breadcrumb { gap: 5px; font-size: 12.5px; color: #909399; }
.breadcrumb .crumb-home { cursor: pointer; }
.breadcrumb .crumb-home:hover { color: var(--dc); }
.breadcrumb .sep { color: #dcdfe6; }
.breadcrumb b { color: #303133; font-weight: 600; }
.header-right { gap: 10px; }
.head-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 4px; color: #606266; cursor: pointer; font-size: 15px; }
.head-icon:hover { background: #f2f6fc; color: var(--dc); }
.tenant-tag { background: #f4f8ff; border-color: #e0edff; font-size: 11.5px; padding: 3px 10px; }
.avatar { width: 28px; height: 28px; font-size: 12px; }

/* ---------- 多页签 ---------- */
.tags-bar {
  height: 34px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; flex-shrink: 0; padding-right: 6px;
}
.tags-scroll { flex: 1; display: flex; align-items: center; gap: 4px; overflow-x: auto; padding: 0 10px; scrollbar-width: none; }
.tags-scroll::-webkit-scrollbar { height: 0; }
.tag {
  display: flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px;
  border: 1px solid var(--line); border-radius: 3px; background: #fff;
  font-size: 12px; color: #606266; cursor: pointer; white-space: nowrap; flex-shrink: 0;
}
.tag:hover { color: var(--dc); border-color: #c6e2ff; }
.tag.active { background: var(--dc); border-color: var(--dc); color: #fff; }
.tag .tag-dot { display: none; width: 5px; height: 5px; border-radius: 50%; background: #fff; }
.tag.active .tag-dot { display: inline-block; }
.tag-close { font-size: 11px; border-radius: 50%; padding: 1px; }
.tag-close:hover { background: rgba(255, 255, 255, .35); }
.tags-actions { display: flex; align-items: center; gap: 2px; padding-left: 6px; border-left: 1px solid #f0f2f5; }
.tag-btn { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 3px; color: #606266; cursor: pointer; font-size: 13px; }
.tag-btn:hover { background: #f2f6fc; color: var(--dc); }

.content { padding: 12px 14px 18px; }

/* 收起态悬浮分组面板 */
.side-pop.el-popover.el-popper { padding: 6px; border-radius: 6px; }
.pop-title { font-size: 11px; color: #909399; padding: 3px 8px 6px; letter-spacing: 1px; }
.pop-item { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 4px; font-size: 13px; color: #303133; cursor: pointer; }
.pop-item:hover { background: #f2f6fc; color: var(--dc); }
.pop-item.active { background: #ecf5ff; color: var(--dc); font-weight: 600; }

/* 页面搜索 */
.ps-list { margin-top: 6px; max-height: 280px; overflow: auto; }
.ps-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 4px; font-size: 13px; cursor: pointer; }
.ps-item:hover { background: #f2f6fc; color: var(--dc); }
.ps-item small { color: #c0c4cc; font-size: 11px; }
.ps-empty { color: #c0c4cc; font-size: 12px; text-align: center; padding: 14px 0; }

/* ---------- 统一列表页模板 ---------- */
.lp { background: #fff; border: 1px solid var(--line); border-radius: 6px; display: flex; flex-direction: column; min-height: calc(100vh - 116px); }
.lp-tabs { display: flex; gap: 22px; padding: 0 16px; border-bottom: 1px solid #f0f2f5; flex-wrap: wrap; }
.lp-tab { position: relative; padding: 10px 1px; font-size: 13px; color: #606266; cursor: pointer; }
.lp-tab:hover { color: var(--dc); }
.lp-tab.active { color: var(--dc); font-weight: 600; }
.lp-tab.active::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--dc); border-radius: 2px; }

.lp-filter { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 20px; padding: 14px 16px 10px; }
.lp-field { display: flex; align-items: center; gap: 8px; min-width: 0; }
.lp-field > label { width: 74px; text-align: right; font-size: 12.5px; color: #606266; flex-shrink: 0; white-space: nowrap; }
.lp-field .el-input, .lp-field .el-select, .lp-field .el-date-editor { flex: 1; min-width: 0; width: 100%; }
.lp-filter-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 0 16px 12px; border-bottom: 1px solid #f0f2f5; }
.lp-left { margin-right: auto; }

.lp-toolbar { display: flex; align-items: center; gap: 16px; padding: 7px 16px; border-bottom: 1px solid #f0f2f5; flex-wrap: wrap; }
.lp-btn { display: inline-flex; align-items: center; gap: 4px; color: var(--dc); font-size: 12.5px; cursor: pointer; padding: 2px 0; }
.lp-btn:hover { color: #1677ff; }
.lp-btn.danger { color: #f56c6c; }
.lp-btn.primary { color: #1677ff; }
.lp-btn.mute { color: #909399; }
.lp-btn.disabled { color: #c0c4cc; cursor: not-allowed; }
.lp-btn.disabled:hover { color: #c0c4cc; }
.col-toggle { display: block; margin-right: 0; height: 26px; }
.lp-btn .el-icon { font-size: 13px; }
.lp-toolbar .spacer { flex: 1; }

.lp-body { flex: 1; min-height: 0; }
.lp-pager { display: flex; align-items: center; gap: 12px; padding: 9px 16px; border-top: 1px solid #f0f2f5; }
.lp-pager .el-pagination { margin-left: auto; }
.lp-sum { font-size: 12.5px; color: #606266; }
.lp-sum b { color: #f56c6c; font-weight: 600; margin: 0 3px; }

.lp-hint { display: flex; align-items: center; gap: 6px; margin: 0 16px; padding: 7px 12px; background: #f4f8ff; border: 1px solid #d9ecff; border-radius: 4px; color: #5c7ba6; font-size: 12px; }
.lp-empty-note { color: #c0c4cc; font-size: 12px; }

/* ---------- 表格单元格式（对齐真实系统的多行堆叠） ---------- */
.el-table th.el-table__cell { background: #f7f8fa; color: #606266; font-size: 12.5px; font-weight: 600; line-height: 1.5; }
.el-table .el-table__cell { padding: 8px 0; font-size: 12.5px; }
.el-table td.el-table__cell .cell { line-height: 1.5; }
.el-table .el-table__row:hover > td.el-table__cell { background: #f7fbff; }
.cell-main { color: #303133; }
.cell-sub { color: #909399; font-size: 11.5px; }
.cell-multi > div { line-height: 1.5; }
.st-running { color: var(--dc); }
.st-success { color: #67c23a; }
.st-fail { color: #f56c6c; }
.st-cache { color: #e6a23c; }
.st-muted { color: #909399; }
.tag-mini { display: inline-block; padding: 0 5px; border-radius: 3px; font-size: 11px; line-height: 17px; border: 1px solid; }
.link-op { color: var(--dc); font-size: 12.5px; cursor: pointer; margin-right: 8px; white-space: nowrap; }

/* ---------- 账户列表：数字与状态的分层展示 ---------- */
.cell-id { color: #606266; font-variant-numeric: tabular-nums; }
.cell-num { color: #f56c6c; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .2px; }
.cell-num.muted { color: #303133; font-weight: 500; }
.cell-num.zero { color: #c0c4cc; font-weight: 400; }
.cell-time { color: #909399; font-size: 11.5px; font-variant-numeric: tabular-nums; line-height: 1.35; }
.cell-link { color: var(--dc); cursor: pointer; }
.cell-link:hover { text-decoration: underline; }
.cell-desc { color: #606266; }
.cell-empty { color: #c0c4cc; }
.cell-select { width: 100%; height: 26px; padding: 0 22px 0 8px; border: 1px solid #dcdfe6; border-radius: 4px; background-color: #fff; color: #303133; font-size: 12px; cursor: pointer; outline: none; appearance: none; -webkit-appearance: none; text-overflow: ellipsis; transition: border-color .15s, box-shadow .15s;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5L6 8l3.5-3.5' fill='none' stroke='%23909399' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 6px center; background-size: 12px 12px; }
.cell-select:hover { border-color: #c0c4cc; }
.cell-select:focus { border-color: var(--dc); box-shadow: 0 0 0 2px rgba(64, 158, 255, .12); }
.pill { display: inline-block; min-width: 40px; padding: 1px 8px; border-radius: 10px; font-size: 12px; line-height: 18px; text-align: center; }
.pill.on { background: #f0f9eb; color: #52a527; }
.pill.off { background: #f4f4f5; color: #909399; }
.cell-multi { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.cell-multi .link-op { margin-right: 0; line-height: 1.55; }
.cell-multi .link-op.mute { color: #909399; }
.link-op:hover { text-decoration: underline; }
.link-op.danger { color: #f56c6c; }
.link-op.mute { color: #909399; }

/* 卡片质感与真实系统一致：更轻的圆角与阴影 */
.panel { border-radius: 6px; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.page-head h2 { font-size: 16px; }
.pager { margin-top: 10px; }

/* 表单页：分组标题（▍基础信息）+ 底部操作条 */
.form-card { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 20px 24px; max-width: 920px; }
.form-section { margin-bottom: 18px; }
.form-section-title { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: #303133; padding-bottom: 10px; border-bottom: 1px solid #f0f2f5; margin-bottom: 14px; }
.form-section-title::before { content: ''; width: 3px; height: 13px; background: var(--dc); border-radius: 2px; }
.form-actions { display: flex; justify-content: center; gap: 12px; padding-top: 8px; }

/* ---------- 系统配置：顶部系统信息 + 分组配置卡 + 底部操作条 ---------- */
.sys-info { margin: 12px 16px 4px; padding: 12px 16px 14px; background: #f4f8ff; border: 1px solid #d9ecff; border-radius: 4px; }
.sys-info-title { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: #1f4f8f; margin-bottom: 10px; }
.sys-info-title::before { content: ''; width: 3px; height: 12px; background: var(--dc); border-radius: 2px; }
.sys-info-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 24px; }
.si-item { display: flex; gap: 8px; font-size: 12.5px; color: #303133; min-width: 0; }
.si-item > label { color: #7d8ba1; width: 72px; flex-shrink: 0; text-align: right; }
.si-item > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cfg-scroll { flex: 1; overflow: auto; padding: 12px 16px 4px; }
.cfg-card { background: #fff; border: 1px solid #eef0f4; border-radius: 6px; padding: 4px 18px 14px; margin-bottom: 12px; }
.cfg-title { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: #303133; padding: 10px 0; border-bottom: 1px solid #f0f2f5; margin-bottom: 6px; }
.cfg-title::before { content: ''; width: 3px; height: 12px; background: var(--dc); border-radius: 2px; }
.cfg-row { display: flex; align-items: flex-start; gap: 14px; padding: 9px 0; border-bottom: 1px dashed #f5f6f8; }
.cfg-row:last-child { border-bottom: 0; }
.cfg-row > label { width: 168px; flex-shrink: 0; text-align: right; font-size: 12.5px; color: #606266; padding-top: 5px; }
.cfg-ctrl { flex: 1; min-width: 0; }
.cfg-hint { margin-top: 4px; font-size: 11.5px; color: #909399; }
.cfg-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 10px 16px; border-top: 1px solid #f0f2f5; background: #fff; position: sticky; bottom: 0; }

/* 通知地址 · 接口模式按钮组 */
.mode-group { display: inline-flex; border: 1px solid #dcdfe6; border-radius: 4px; overflow: hidden; }
.mode-btn { padding: 7px 20px; font-size: 12.5px; color: #606266; background: #fff; cursor: pointer; border-right: 1px solid #dcdfe6; user-select: none; }
.mode-btn:last-child { border-right: 0; }
.mode-btn:hover { color: var(--dc); }
.mode-btn.active { background: var(--dc); border-color: var(--dc); color: #fff; }

/* ---------- 通用 CRUD 弹窗表单 ---------- */
.crud-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.crud-grid .full { grid-column: span 2; }
.crud-form .el-form-item { margin-bottom: 16px; }
.crud-form .el-select, .crud-form .el-input-number { width: 100%; }
.num { font-variant-numeric: tabular-nums; }

@media (max-width: 760px) {
  .crud-grid { grid-template-columns: minmax(0, 1fr); }
  .crud-grid .full { grid-column: span 1; }
}

@media (max-width: 1200px) {
  .sys-info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1200px) {
  .lp-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
  .lp-filter { grid-template-columns: 1fr; }
}
