/* ===== 全局重置 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }

/* ===== 布局容器 ===== */
.admin-layout { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

/* ===== 顶部导航 ===== */
.admin-header {
  height: 60px; background: #2d3a4b; display: flex; align-items: center;
  justify-content: space-between; padding: 0 20px; color: #fff; z-index: 1000;
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.admin-header .logo { display: flex; align-items: center; font-size: 18px; font-weight: 700; color: #fff; letter-spacing: 1px; }
.admin-header .logo i { font-size: 26px; margin-right: 10px; color: #1e9fff; }
.admin-header .header-right { display: flex; align-items: center; gap: 20px; }
.admin-header .header-right .header-item {
  display: flex; align-items: center; cursor: pointer; color: #bfcbd9; font-size: 14px; transition: color .2s;
}
.admin-header .header-right .header-item:hover { color: #fff; }
.admin-header .header-right .header-item i { font-size: 18px; margin-right: 6px; }
.admin-header .header-right .avatar { width: 32px; height: 32px; border-radius: 50%; background: #1e9fff; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 14px; font-weight: 600; margin-right: 8px; }

/* ===== 主体区域 ===== */
.admin-body { display: flex; flex: 1; overflow: hidden; }

/* ===== 左侧菜单 ===== */
.admin-sidebar {
  width: 220px; background: #1f2d3d; overflow-y: auto; overflow-x: hidden;
  transition: width .3s ease; flex-shrink: 0; scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}
.admin-sidebar::-webkit-scrollbar { width: 4px; }
.admin-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }
.admin-sidebar.collapsed { width: 64px; }
.admin-sidebar.collapsed .menu-title { display: none; }
.admin-sidebar.collapsed .layui-nav-item > a cite,
.admin-sidebar.collapsed .layui-nav-item > a .layui-nav-more { display: none !important; }
.admin-sidebar.collapsed .layui-nav-item > a { text-align: center; padding: 0; justify-content: center; }
.admin-sidebar.collapsed .layui-nav-item > a > i { margin-right: 0; font-size: 20px; display: inline-block !important; }

/* 侧边栏导航样式 */
.sidebar-nav { background: transparent !important; padding: 8px 0; width: 100% !important; }
.sidebar-nav .layui-nav-item a {
  display: flex; align-items: center; height: 48px; line-height: 48px;
  padding: 0 20px; color: #bfcbd9 !important; font-size: 14px; transition: all .2s;
}
.sidebar-nav .layui-nav-item a i { font-size: 16px; margin-right: 10px; width: 20px; text-align: center; }
.sidebar-nav .layui-nav-item a:hover { background: rgba(255,255,255,.05) !important; color: #fff !important; }
.sidebar-nav .layui-nav-item.layui-this > a,
.sidebar-nav .layui-nav-item .layui-nav-child dd.layui-this a {
  background: #1e9fff !important; color: #fff !important; border-radius: 0;
}
.sidebar-nav .layui-nav-item .layui-nav-child {
  background: rgba(0,0,0,.15) !important; position: static !important;
  box-shadow: none !important; border: none;
}
.sidebar-nav .layui-nav-item .layui-nav-child dd a { padding-left: 50px; height: 42px; line-height: 42px; font-size: 13px; }
.sidebar-nav .layui-nav-bar { display: none; }

/* 折叠时子菜单在侧边栏内展开显示 */
.admin-sidebar.collapsed .sidebar-nav .layui-nav-item .layui-nav-child {
  display: none;
  position: static !important;
  background: rgba(0,0,0,.2) !important;
  box-shadow: none !important;
  padding: 0;
}
.admin-sidebar.collapsed .sidebar-nav .layui-nav-item.layui-nav-itemed > .layui-nav-child {
  display: block !important;
}
.admin-sidebar.collapsed .sidebar-nav .layui-nav-item .layui-nav-child dd a {
  padding-left: 0 !important;
  text-align: center;
  height: 40px;
  line-height: 40px;
  justify-content: center;
}
.admin-sidebar.collapsed .sidebar-nav .layui-nav-item .layui-nav-child dd a i {
  margin-right: 0;
  font-size: 18px;
}
.admin-sidebar.collapsed .sidebar-nav .layui-nav-item .layui-nav-child dd a span,
.admin-sidebar.collapsed .sidebar-nav .layui-nav-item .layui-nav-child dd a cite {
  display: none;
}

/* 菜单分组标题 */
.menu-title {
  padding: 16px 20px 8px; font-size: 12px; color: rgba(255,255,255,.35);
  text-transform: uppercase; letter-spacing: 1px; white-space: nowrap;
}

/* ===== 右侧内容区 ===== */
.admin-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: #f0f2f5; }

/* Tab标签栏 */
.admin-tabs {
  background: #fff; border-bottom: 1px solid #e6e6e6; padding: 0 12px;
  display: flex; align-items: center; min-height: 40px; flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.admin-tabs .tab-list { display: flex; align-items: center; flex: 1; overflow-x: auto; gap: 4px; scrollbar-width: none; }
.admin-tabs .tab-list::-webkit-scrollbar { display: none; }
.admin-tabs .tab-item {
  display: flex; align-items: center; padding: 0 14px; height: 32px; line-height: 32px;
  font-size: 13px; color: #666; cursor: pointer; border-radius: 4px; white-space: nowrap;
  transition: all .2s; gap: 6px; user-select: none; flex-shrink: 0;
}
.admin-tabs .tab-item:hover { background: #f0f2f5; color: #333; }
.admin-tabs .tab-item.active { background: #1e9fff; color: #fff; }
.admin-tabs .tab-item .tab-close { font-size: 12px; border-radius: 50%; width: 16px; height: 16px; display: flex; align-items: center; justify-content: center; transition: background .2s; }
.admin-tabs .tab-item .tab-close:hover { background: rgba(0,0,0,.15); }
.admin-tabs .tab-actions { display: flex; align-items: center; margin-left: 8px; flex-shrink: 0; }
.admin-tabs .tab-actions .layui-btn { height: 28px; line-height: 28px; padding: 0 10px; font-size: 12px; }

/* 内容iframe */
.admin-main { flex: 1; overflow: hidden; position: relative; }
.admin-main iframe { width: 100%; height: 100%; border: none; }

/* ===== 控制台卡片 ===== */
.stat-card {
  background: #fff; border-radius: 8px; padding: 24px; position: relative;
  overflow: hidden; transition: box-shadow .3s, transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.stat-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.1); transform: translateY(-2px); }
.stat-card .stat-icon {
  width: 56px; height: 56px; border-radius: 12px; display: flex;
  align-items: center; justify-content: center; font-size: 26px; color: #fff; margin-bottom: 16px;
}
.stat-card .stat-icon.blue { background: linear-gradient(135deg, #1e9fff, #0081e4); }
.stat-card .stat-icon.green { background: linear-gradient(135deg, #16b777, #0d9b5f); }
.stat-card .stat-icon.orange { background: linear-gradient(135deg, #ffb800, #e6a200); }
.stat-card .stat-icon.red { background: linear-gradient(135deg, #ff5722, #e64a19); }
.stat-card .stat-num { font-size: 28px; font-weight: 700; color: #333; margin-bottom: 4px; }
.stat-card .stat-label { font-size: 14px; color: #999; }
.stat-card .stat-trend { position: absolute; top: 24px; right: 24px; font-size: 13px; display: flex; align-items: center; gap: 4px; }
.stat-card .stat-trend.up { color: #16b777; }
.stat-card .stat-trend.down { color: #ff5722; }

/* ===== 面板 ===== */
.panel {
  background: #fff; border-radius: 8px; margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.panel-header { padding: 16px 20px; border-bottom: 1px solid #f0f0f0; display: flex; align-items: center; justify-content: space-between; }
.panel-header .panel-title { font-size: 15px; font-weight: 600; color: #333; }
.panel-body { padding: 20px; }

/* ===== 快捷操作 ===== */
.shortcut-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 16px; cursor: pointer; border-radius: 8px; transition: background .2s;
}
.shortcut-item:hover { background: #f7f8fa; }
.shortcut-item i { font-size: 28px; margin-bottom: 8px; }
.shortcut-item span { font-size: 13px; color: #666; }

/* ===== 动态列表 ===== */
.activity-item { display: flex; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid #f5f5f5; }
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; margin-right: 14px; flex-shrink: 0; }
.activity-content { flex: 1; }
.activity-content .activity-text { font-size: 14px; color: #333; line-height: 1.5; }
.activity-content .activity-time { font-size: 12px; color: #999; margin-top: 4px; }

/* ===== 表格页面 ===== */
.page-container { padding: 16px; }
.search-bar { background: #fff; border-radius: 8px; padding: 16px 20px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }

/* ===== 全局美化 ===== */
.layui-table { border-radius: 8px; overflow: hidden; }
.layui-btn { border-radius: 4px; }
.layui-input, .layui-select, .layui-textarea { border-radius: 4px; }

/* ===== 折叠按钮 ===== */
.toggle-sidebar { cursor: pointer; font-size: 20px; color: #bfcbd9; transition: color .2s; padding: 4px; }
.toggle-sidebar:hover { color: #fff; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .admin-sidebar { position: fixed; left: -220px; top: 60px; bottom: 0; z-index: 999; transition: left .3s; }
  .admin-sidebar.mobile-show { left: 0; }
  .admin-sidebar.collapsed { left: -64px; }
}

/* ===== 页面内表单样式 ===== */
.page-body { background: #fff; border-radius: 8px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }

/* ===== 进度条 ===== */
.progress-wrap { margin-bottom: 12px; }
.progress-wrap .progress-label { display: flex; justify-content: space-between; font-size: 13px; color: #666; margin-bottom: 6px; }
.progress-wrap .layui-progress { border-radius: 4px; }

/* ===== 登录页 ===== */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #1f2d3d 0%, #2d3a4b 100%); }
.login-box { background: #fff; border-radius: 12px; padding: 40px; width: 400px; max-width: 90vw; box-shadow: 0 8px 32px rgba(0,0,0,.2); }
.login-box .login-title { text-align: center; font-size: 24px; font-weight: 700; color: #333; margin-bottom: 8px; }
.login-box .login-subtitle { text-align: center; font-size: 14px; color: #999; margin-bottom: 32px; }
.login-box .layui-form-item { margin-bottom: 20px; }
.login-box .layui-input { height: 42px; line-height: 42px; border-radius: 6px; }
.login-box .login-btn { width: 100%; height: 44px; font-size: 16px; border-radius: 6px; }
