/* 公共样式 - 所有管理子页面共享 */
body {
  background: #f1f5f9;
  padding: 20px;
  font-family: 'Microsoft YaHei', -apple-system, sans-serif;
  margin: 0;
}

/* 卡片容器 */
.card {
  background: #fff;
  border-radius: 10px;
  padding: 20px 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  border: 1px solid #e2e8f0;
}

/* 搜索/工具栏 */
.search-bar,
.toolbar {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f1f5f9;
}
.search-bar .layui-input-inline,
.toolbar .layui-input-inline {
  margin-right: 10px;
  margin-bottom: 8px;
}
.search-bar .layui-btn,
.toolbar .layui-btn {
  margin-bottom: 8px;
  margin-right: 6px;
}

/* 表格美化 */
.layui-table {
  border-radius: 6px;
  overflow: hidden;
}
.layui-table thead th {
  background: #f8fafc !important;
  color: #475569;
  font-weight: 600;
  font-size: 13px;
}
.layui-table tbody td {
  color: #334155;
  font-size: 13px;
}
.layui-table tbody tr:hover td {
  background: #f8fafc !important;
}

/* 分页美化 */
.layui-laypage a,
.layui-laypage span {
  border-radius: 6px !important;
}
.layui-laypage .layui-laypage-curr .layui-laypage-em {
  background: #3b82f6 !important;
  border-radius: 6px !important;
}

/* Badge 颜色 */
.layui-badge-green { background-color: #10b981; }
.layui-badge-blue { background-color: #3b82f6; }
.layui-badge-gray { background-color: #94a3b8; }
.layui-badge-red { background-color: #ef4444; }
.layui-badge-orange { background-color: #f59e0b; }

/* 按钮微调 */
.layui-btn {
  border-radius: 6px;
}
.layui-btn-xs {
  border-radius: 4px;
}

/* 输入框微调 */
.layui-input,
.layui-textarea,
.layui-select {
  border-radius: 6px;
  border-color: #e2e8f0;
}
.layui-input:focus,
.layui-textarea:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

/* 自定义表格（configs/variables） */
.config-table,
.var-table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
}
.config-table th, .var-table th {
  background: #f8fafc;
  font-weight: 600;
  color: #475569;
  padding: 12px 14px;
  text-align: left;
  font-size: 13px;
  border-bottom: 1px solid #e2e8f0;
}
.config-table td, .var-table td {
  padding: 10px 14px;
  color: #334155;
  font-size: 13px;
  border-bottom: 1px solid #f1f5f9;
  word-break: break-all;
}
.config-table tr:last-child td,
.var-table tr:last-child td {
  border-bottom: none;
}
.config-table tr:hover td,
.var-table tr:hover td {
  background: #f8fafc;
}

/* 空数据提示 */
.empty-tip {
  text-align: center;
  padding: 48px 0;
  color: #94a3b8;
  font-size: 14px;
}

/* 分页器 */
.pager {
  text-align: center;
  margin-top: 16px;
}

/* 复制按钮 */
.copy-btn {
  cursor: pointer;
  color: #3b82f6;
  font-size: 12px;
  margin-left: 4px;
}
.copy-btn:hover {
  text-decoration: underline;
}
.key-cell {
  display: flex;
  align-items: center;
  word-break: break-all;
}
.key-cell span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 日志详情 */
.detail-cell {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

/* 快捷按钮栏 */
.quick-bar {
  margin-bottom: 16px;
}
.quick-bar .layui-btn {
  padding: 0 12px;
  margin-right: 6px;
  margin-bottom: 6px;
}

/* ==================== 下拉选择框美化 ==================== */

/* 选择框外框 */
.layui-form-select .layui-input {
  border-radius: 6px;
  border-color: #e2e8f0;
  height: 38px;
  line-height: 38px;
  color: #334155;
  font-size: 13px;
  background: #fff;
  transition: all 0.2s;
  cursor: pointer;
}
.layui-form-select .layui-input:hover {
  border-color: #94a3b8;
}

/* 展开状态 */
.layui-form-select .layui-anim-upbit,
.layui-form-select .layui-anim {
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 6px 16px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  margin-top: 4px;
  padding: 4px 0;
  overflow: hidden;
}

/* 选中态边框 */
.layui-form-selected .layui-input {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

/* 下拉箭头 */
.layui-form-select .layui-edge {
  border-top-color: #94a3b8;
  right: 12px;
  margin-top: -3px;
  transition: transform 0.2s;
}
.layui-form-selected .layui-edge {
  border-top-color: #3b82f6;
  margin-top: -6px;
}

/* 下拉选项 */
.layui-form-select dl dd {
  padding: 0 14px;
  line-height: 36px;
  font-size: 13px;
  color: #475569;
  border-radius: 4px;
  margin: 2px 4px;
  transition: all 0.15s;
}
.layui-form-select dl dd:hover {
  background: #f1f5f9;
  color: #1e293b;
}

/* 选中项 */
.layui-form-select dl dd.layui-this {
  background: rgba(59,130,246,0.08);
  color: #3b82f6;
  font-weight: 500;
}

/* 禁用项 */
.layui-form-select dl dd.layui-disabled {
  color: #cbd5e1;
}

/* 搜索栏内的下拉框高度对齐 */
.search-bar .layui-form-select .layui-input,
.toolbar .layui-form-select .layui-input,
.filter-bar .layui-form-select .layui-input {
  height: 38px;
  line-height: 38px;
}

/* ==================== 开关按钮美化 ==================== */
.layui-form-switch {
  height: 24px;
  line-height: 24px;
  min-width: 44px;
  border-radius: 12px;
  background: #cbd5e1;
  border-color: #cbd5e1;
  transition: all 0.25s;
}
.layui-form-switch em {
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: all 0.25s;
}
.layui-form-onswitch {
  background: #3b82f6;
  border-color: #3b82f6;
}
.layui-form-onswitch em {
  left: calc(100% - 22px);
}
.layui-form-switch span {
  font-size: 12px;
}

/* ==================== 弹窗表单美化 ==================== */
.layui-layer {
  border-radius: 10px !important;
  overflow: hidden;
}
.layui-layer-title {
  background: #f8fafc !important;
  border-bottom: 1px solid #e2e8f0 !important;
  color: #1e293b !important;
  font-weight: 600 !important;
  font-size: 15px !important;
  padding: 0 16px !important;
  height: 48px !important;
  line-height: 48px !important;
}
.layui-layer-btn a {
  border-radius: 6px !important;
}
.layui-layer-btn .layui-layer-btn0 {
  background: #3b82f6 !important;
  border-color: #3b82f6 !important;
}

/* ==================== 复选框美化 ==================== */
.layui-form-checkbox[lay-skin="primary"] i {
  border-radius: 4px;
  border-color: #cbd5e1;
  transition: all 0.2s;
}
.layui-form-checked[lay-skin="primary"] i {
  background: #3b82f6;
  border-color: #3b82f6;
}

/* ==================== 日期选择器美化 ==================== */
.layui-laydate {
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
  border: 1px solid #e2e8f0;
}
.layui-laydate .layui-laydate-header {
  border-bottom: 1px solid #f1f5f9;
}
.layui-laydate .layui-this {
  background: #3b82f6 !important;
}
.layui-laydate .layui-laydate-footer .layui-laydate-btns span:hover {
  color: #3b82f6;
}

/* ==================== 移动端适配 ==================== */
@media (max-width: 768px) {
  body {
    padding: 12px;
  }

  .card {
    padding: 14px;
    border-radius: 8px;
    overflow-x: auto;
  }

  .search-bar,
  .toolbar,
  .quick-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 12px;
  }

  .search-bar .layui-input-inline,
  .toolbar .layui-input-inline,
  .quick-bar .layui-input-inline,
  .filter-bar .layui-input-inline {
    width: 100% !important;
    margin-right: 0;
    margin-bottom: 0;
  }

  .search-bar .layui-btn,
  .toolbar .layui-btn,
  .quick-bar .layui-btn,
  .filter-bar .layui-btn {
    margin: 0;
  }

  .layui-table-view {
    min-width: 980px;
  }

  .layui-layer {
    width: calc(100vw - 24px) !important;
    left: 12px !important;
  }
}
