/* ==========================================================================
   管家婆辉煌II TOP+ 风格 —— 淡蓝色主题
   主色调：#4A90D9   辅助色：#E8F0FE   背景色：#F5F8FC
   ========================================================================== */

/* ---------- 1. CSS 变量（主题 token） ---------- */
:root {
  /* 品牌色 */
  --primary:        #4A90D9;   /* 主色 */
  --primary-hover:  #3A7BC8;   /* 主色 hover */
  --primary-active: #2E6AB5;   /* 主色按下 */
  --primary-light:  #E8F0FE;   /* 主色浅背景 */
  --primary-soft:   #D6E6FA;   /* 主色更浅 */

  /* 中性色 */
  --bg-page:    #F5F8FC;       /* 页面背景 */
  --bg-card:    #FFFFFF;       /* 卡片/表格背景 */
  --bg-header:  #3C8DBC;       /* 顶部导航条（深蓝，仿管家婆） */
  --bg-aside:   #2B3A4B;       /* 左侧菜单（深灰蓝） */
  --bg-aside-hover: #4A90D9;   /* 左侧 hover */
  --bg-submenu: #1F2D3D;       /* 子菜单背景 */

  /* 文字 */
  --text-main:  #333333;
  --text-sub:   #666666;
  --text-muted: #999999;
  --text-inverse: #FFFFFF;

  /* 边框 & 分隔 */
  --border:     #E4E9F0;
  --border-light: #EEF2F7;

  /* 状态色 */
  --success: #1AB394;
  --warning: #F8AC59;
  --danger:  #ED5565;
  --info:    #4A90D9;

  /* 尺寸 */
  --header-h:   52px;
  --aside-w:    220px;
  --aside-w-min: 0px;          /* 折叠后宽度 */
  --tabs-h:     38px;
  --radius:     2px;
  --shadow-card: 0 1px 3px rgba(74,144,217,.08);
}

/* ---------- 2. 全局重置 ---------- */
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  height: 100%;
  font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  font-size: 13px;
  color: var(--text-main);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

/* ---------- 3. 顶部导航 ---------- */
.app-header {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: linear-gradient(90deg, #3C8DBC 0%, #4A90D9 100%);
  color: var(--text-inverse);
  display: flex; align-items: center;
  padding: 0 18px;
  z-index: 1000;
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.app-header .logo {
  font-size: 16px; font-weight: 600;
  letter-spacing: 1px;
  display: flex; align-items: center;
  min-width: var(--aside-w);
}
.app-header .logo-icon {
  display: inline-block; width: 26px; height: 26px;
  background: #fff; border-radius: 4px; margin-right: 10px;
  line-height: 26px; text-align: center;
  color: var(--primary); font-weight: 700; font-size: 14px;
}
.app-header .top-nav {
  flex: 1;
  display: flex; align-items: center;
  padding-left: 20px;
}
.app-header .top-nav a {
  color: rgba(255,255,255,.85);
  padding: 0 14px; height: var(--header-h); line-height: var(--header-h);
  font-size: 13px;
}
.app-header .top-nav a:hover,
.app-header .top-nav a.active {
  background: rgba(255,255,255,.12);
  color: #fff;
}
.app-header .header-right {
  display: flex; align-items: center; gap: 14px;
  font-size: 13px;
}
.app-header .header-right .user-info {
  color: #fff; opacity: .9;
}
.app-header .header-right a {
  color: rgba(255,255,255,.85);
}
.app-header .header-right a:hover { color: #fff; }
.collapse-btn {
  cursor: pointer; color: #fff; font-size: 18px; padding: 0 10px;
  opacity: .9;
}
.collapse-btn:hover { opacity: 1; }

/* ---------- 4. 左侧菜单 ---------- */
.app-aside {
  position: fixed;
  top: var(--header-h); left: 0; bottom: 0;
  width: var(--aside-w);
  background: var(--bg-aside);
  overflow-y: auto;
  overflow-x: hidden;
  transition: width .25s ease;
  z-index: 999;
}
.app-aside.collapsed { width: 0; }
.app-aside.collapsed .menu-wrap { display: none; }

/* 滚动条 */
.app-aside::-webkit-scrollbar { width: 6px; }
.app-aside::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.15); border-radius: 3px;
}

.menu-group { border-bottom: 1px solid rgba(255,255,255,.04); }
.menu-group-title {
  padding: 12px 18px;
  color: rgba(255,255,255,.65);
  font-size: 12px; font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  user-select: none;
}
.menu-group-title .icon {
  display: inline-block; width: 16px; height: 16px;
  background: rgba(255,255,255,.15);
  border-radius: 3px; margin-right: 10px;
  text-align: center; line-height: 16px; font-size: 11px;
}
.menu-group-title .arrow {
  font-size: 10px; transition: transform .2s;
}
.menu-group.collapsed .menu-group-title .arrow { transform: rotate(-90deg); }
.menu-group.collapsed .menu-group-items { display: none; }

.menu-group-items { background: var(--bg-submenu); }
.menu-item {
  display: flex; align-items: center;
  padding: 10px 18px 10px 44px;
  color: rgba(255,255,255,.75);
  font-size: 13px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all .15s;
}
.menu-item:hover {
  background: rgba(74,144,217,.18);
  color: #fff;
}
.menu-item.active {
  background: var(--bg-aside-hover);
  color: #fff;
  border-left-color: #fff;
}
.menu-item::before {
  content: "";
  width: 5px; height: 5px; border-radius: 50%;
  background: rgba(255,255,255,.4);
  margin-right: 10px;
}
.menu-item.active::before { background: #fff; }

/* ---------- 5. 右侧主体 + 多标签 ---------- */
.app-main {
  margin-top: var(--header-h);
  margin-left: var(--aside-w);
  transition: margin-left .25s ease;
  min-height: calc(100vh - var(--header-h));
  display: flex; flex-direction: column;
}
.app-aside.collapsed ~ .app-main { margin-left: 0; }

.app-tabs {
  height: var(--tabs-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: stretch;
  padding: 0 8px;
  overflow-x: auto;
  position: sticky; top: var(--header-h); z-index: 10;
}
.app-tabs::-webkit-scrollbar { height: 0; }

.app-tab {
  display: inline-flex; align-items: center;
  padding: 0 14px;
  border-right: 1px solid var(--border-light);
  color: var(--text-sub);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: all .15s;
  background: #fff;
}
.app-tab:hover { color: var(--primary); }
.app-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: var(--primary-light);
}
.app-tab .close {
  margin-left: 8px;
  font-size: 14px; color: var(--text-muted);
  width: 16px; height: 16px; line-height: 14px;
  border-radius: 50%; text-align: center;
}
.app-tab .close:hover { background: var(--danger); color: #fff; }
.app-tab.home-tab .close { display: none; }

.app-content {
  flex: 1;
  background: var(--bg-page);
  padding: 14px;
  overflow: auto;
}
.app-content iframe {
  width: 100%; height: 100%; border: 0;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

/* ---------- 6. 页面容器 & 面包屑 ---------- */
.page-container {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 16px 18px;
}
.page-breadcrumb {
  padding: 8px 0 14px;
  font-size: 12px; color: var(--text-muted);
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 14px;
}
.page-breadcrumb .sep { margin: 0 6px; color: #ccc; }
.page-title {
  font-size: 15px; font-weight: 600; color: var(--text-main);
  margin: 0 0 14px;
  padding-left: 10px; border-left: 3px solid var(--primary);
}

/* ---------- 7. 搜索 & 工具栏 ---------- */
.search-bar {
  background: var(--primary-light);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 14px;
  display: flex; flex-wrap: wrap; gap: 12px 18px;
  align-items: flex-end;
}
.search-bar .layui-form-item { margin-bottom: 0; }
.search-bar .layui-form-label { padding: 9px 8px; font-size: 12px; width: auto; color: var(--text-sub); }
.search-bar .layui-input,
.search-bar .layui-select { height: 32px; font-size: 12px; }

.toolbar {
  display: flex; gap: 8px;
  padding: 10px 0 12px;
}

/* ---------- 8. Layui 组件覆盖 ---------- */

/* 按钮 */
.layui-btn {
  border-radius: var(--radius);
  font-size: 12px;
  padding: 0 16px;
  height: 32px; line-height: 32px;
  background: var(--primary);
  box-shadow: none;
}
.layui-btn:hover { background: var(--primary-hover); }
.layui-btn-normal { background: var(--primary); }
.layui-btn-primary {
  background: #fff; color: var(--primary);
  border: 1px solid var(--primary);
}
.layui-btn-primary:hover { background: var(--primary-light); color: var(--primary-hover); }
.layui-btn-sm { height: 28px; line-height: 28px; padding: 0 12px; font-size: 12px; }
.layui-btn-danger { background: var(--danger); }
.layui-btn-warm  { background: var(--warning); }

/* 表格 */
.layui-table {
  border-radius: var(--radius);
  overflow: hidden;
}
.layui-table-view .layui-table[lay-skin=line],
.layui-table-view .layui-table {
  border-top: 1px solid var(--primary) !important;
}
.layui-table thead tr { background: var(--primary-light) !important; }
.layui-table thead tr th {
  color: #3C6FA0; font-weight: 600; font-size: 12px;
  background: var(--primary-light);
}
.layui-table tbody tr:hover { background: #F0F6FE !important; }
.layui-table tbody tr.layui-table-click { background: #E1ECFB !important; }
.layui-table td, .layui-table th {
  font-size: 12px;
  padding: 9px 8px;
  border-color: var(--border-light);
}
.layui-table-col-special { background: #FAFBFD !important; }

/* 分页 */
.layui-laypage a, .layui-laypage span {
  border-radius: var(--radius);
  font-size: 12px;
}
.layui-laypage .layui-laypage-curr .layui-laypage-em {
  background: var(--primary);
}

/* 表单 */
.layui-input, .layui-textarea, .layui-select {
  border-radius: var(--radius);
  border-color: #D8E3EF;
  font-size: 12px;
}
.layui-input:focus, .layui-textarea:focus, .layui-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(74,144,217,.15);
}
.layui-form-label { font-size: 12px; color: var(--text-sub); }
.layui-form-required::before { color: var(--danger); }

/* 弹窗 */
.layui-layer.layui-layer-page .layui-layer-content { padding: 0; }
.layui-layer-title {
  background: linear-gradient(90deg, #3C8DBC 0%, #4A90D9 100%) !important;
  color: #fff !important;
  font-weight: 600;
  font-size: 13px;
  border-bottom: none;
}
.layui-layer-setwin .layui-layer-close1 { background-position: -150px -60px; }

/* Tab（Layui） */
.layui-tab-brief > .layui-tab-title .layui-this {
  color: var(--primary);
}
.layui-tab-brief > .layui-tab-title .layui-this:after {
  background: var(--primary);
}

/* 下拉 select */
.layui-form-select dl dd.layui-this { background: var(--primary); }

/* ---------- 9. 辅助 ---------- */
.text-muted { color: var(--text-muted); }
.text-sub   { color: var(--text-sub); }
.text-primary { color: var(--primary); }
.text-danger  { color: var(--danger); }
.text-success { color: var(--success); }

.tal { text-align: left !important; }
.tac { text-align: center !important; }
.tar { text-align: right !important; }

.muted-link {
  color: var(--primary);
  cursor: pointer;
  margin-right: 8px;
}
.muted-link:hover { text-decoration: underline; }
.muted-link.danger { color: var(--danger); }

/* 清空修复 */
.clearfix::after { content: ""; display: block; clear: both; }
