/* ============================================================
   瀚思教育 OA 主题（参考致远 OA 风格）
   深色侧边栏 + 卡片化内容 + 全设备适配
   ============================================================ */

/* ---------- 全局背景 ---------- */
.bg-slate-50 { background-color: #f4f6fb !important; }

/* ---------- 深色侧边栏（桌面常驻 + 移动抽屉） ---------- */
aside {
  background: linear-gradient(180deg, #1e2a45 0%, #141c33 100%) !important;
  border-right: none !important;
  box-shadow: 4px 0 16px rgba(15, 23, 42, 0.12);
}
/* logo 区 */
aside > div:first-child {
  border-bottom: 1px solid rgba(148, 163, 184, 0.16) !important;
}
aside > div:first-child .font-bold { color: #f8fafc !important; }
aside > div:first-child .text-xs { color: #94a3b8 !important; }
/* 导航链接 */
aside nav a {
  color: #c2cbe0 !important;
}
aside nav a:hover {
  background: rgba(148, 163, 184, 0.14) !important;
  color: #ffffff !important;
}
/* 当前页（NavLink active） */
aside nav a.bg-blue-50 {
  background: linear-gradient(90deg, #2563eb, #3b82f6) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}
/* 底部区域 */
aside > div:last-child { border-top: 1px solid rgba(148, 163, 184, 0.16) !important; }
aside > div:last-child .text-sm { color: #e2e8f0 !important; }
aside > div:last-child .text-xs { color: #94a3b8 !important; }
/* 底部退出按钮 */
aside button {
  color: #cbd5e1 !important;
}
aside button:hover {
  background: rgba(220, 38, 38, 0.16) !important;
  color: #fca5a5 !important;
}

/* ---------- 顶部 header ---------- */
header {
  background: #ffffff !important;
  border-bottom: 1px solid #e8edf5 !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

/* ---------- 卡片化（带边框的容器） ---------- */
main .rounded-xl,
main .rounded-lg {
  border-color: #e8edf5 !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.03);
}

/* ---------- 主按钮统一 ---------- */
.bg-blue-600,
.bg-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

/* ============================================================
   手机 / 平板适配（参考致远：单列、整页可下滑、触控友好）
   ============================================================ */
@media (max-width: 1023px) {
  /* 根容器不再固定高度、不再裁剪，让整页自然下滑 */
  .h-screen {
    height: auto !important;
    min-height: 100vh;
    overflow: visible !important;
  }
  /* 主内容列：锁定为视口宽度，不被宽表格撑开 */
  .flex-1.flex.flex-col.min-w-0 {
    width: 100vw !important;
    max-width: 100vw !important;
  }
  /* 主内容区不再内部滚动，全部展开，由页面整体滚动 */
  main {
    overflow: visible !important;
    padding: 12px !important;
    width: 100% !important;
    max-width: 100vw !important;
  }
  /* 顶部细栏固定，方便随时打开菜单/看角色 */
  header {
    position: sticky;
    top: 0;
    z-index: 30;
  }
  /* 表格：硬约束表格承载列，再由 ant-table-body 横向滚动（表头由 Ant Design 内部同步），不做纵向嵌套滚动 */
  .flex-1.outline-none.mt-4 {
    width: 100% !important;
    max-width: 100% !important;
    overflow: visible !important;
  }
  .ant-table-wrapper {
    max-width: 100% !important;
  }
  .ant-table-container {
    overflow: visible !important;
  }
  .ant-table-body {
    width: 100% !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch;
  }
  /* 保证表格有最小宽度，列不被压缩，可横向滑动查看 */
  .ant-table-body > table {
    min-width: 900px !important;
    width: 900px !important;
  }
  /* 按钮触控区加大、不挤在一行 */
  main button {
    min-height: 40px;
  }
  /* 工具栏按钮允许换行（仅主内容，不影响侧边栏布局） */
  main .flex {
    flex-wrap: wrap;
  }
}

/* 手机：筛选区单列、占满宽度（不影响首页统计卡 2 列） */
@media (max-width: 640px) {
  main .grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
}

/* 小屏手机：进一步收紧 */
@media (max-width: 480px) {
  main { padding: 10px !important; }
  header { height: auto !important; min-height: 52px; }
}

/* ============================================================
   工作台数据看板
   ============================================================ */
.hz-panel {
  background: #ffffff;
  border: 1px solid #e8edf5;
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 18px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}
.hz-panel-title {
  display: flex;
  align-items: center;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 16px;
}
.hz-panel-bar {
  width: 4px;
  height: 16px;
  border-radius: 2px;
  background: linear-gradient(180deg, #2563eb, #3b82f6);
  margin-right: 8px;
}
.hz-panel-sub {
  margin-left: auto;
  font-size: 12px;
  font-weight: 400;
  color: #94a3b8;
}

/* 统计卡片 */
.hz-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.hz-stat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid #eef1f6;
  border-radius: 12px;
  background: #fbfcfe;
}
.hz-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.hz-stat-num { font-size: 24px; font-weight: 700; line-height: 1.1; }
.hz-stat-label { font-size: 13px; color: #64748b; margin-top: 2px; }

/* 图表区 */
.hz-chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.hz-chart-card {
  border: 1px solid #eef1f6;
  border-radius: 12px;
  padding: 16px;
  background: #fbfcfe;
}
.hz-chart-title {
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 14px;
}
.hz-empty { color: #94a3b8; font-size: 13px; text-align: center; padding: 30px 0; }

/* 环形图 */
.hz-donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.hz-donut {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}
.hz-donut-center {
  position: absolute;
  inset: 22px;
  background: #fbfcfe;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.hz-donut-num { font-size: 22px; font-weight: 700; color: #0f172a; }
.hz-donut-label { font-size: 11px; color: #94a3b8; }
.hz-legend { flex: 1; min-width: 120px; }
.hz-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 4px 0;
}
.hz-legend-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.hz-legend-name { color: #475569; flex: 1; }
.hz-legend-val { font-weight: 600; color: #1e293b; }

/* 条形图 */
.hz-bars { display: flex; flex-direction: column; gap: 12px; }
.hz-bar-row { display: flex; flex-direction: column; gap: 5px; }
.hz-bar-name { font-size: 12px; color: #475569; }
.hz-bar-track {
  height: 22px;
  background: #eef1f6;
  border-radius: 6px;
  overflow: hidden;
}
.hz-bar-fill {
  height: 100%;
  border-radius: 6px;
  min-width: 26px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
}

/* 看板响应式 */
@media (max-width: 768px) {
  .hz-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .hz-chart-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .hz-panel { padding: 14px; }
  .hz-stat-card { padding: 12px; }
}

/* ============================================================
   手机端兜底：按 UA 强制（不依赖视口宽度，防 WebView 桌面宽度渲染）
   ============================================================ */
.hz-is-mobile {
  /* 侧边栏：固定在画布外，打开时滑入 */
}
.hz-is-mobile aside {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 240px !important;
  height: 100% !important;
  flex-wrap: nowrap !important;
  transform: translateX(-100%) !important;
}
.hz-is-mobile aside.translate-x-0 {
  transform: translateX(0) !important;
}
/* 手机布局：强制显示手机汉堡、隐藏桌面折叠按钮（即使视口被报成桌面宽度） */
.hz-is-mobile header button.lg\:hidden {
  display: inline-flex !important;
}
.hz-is-mobile header button.hidden.lg\:flex {
  display: none !important;
}
/* 侧边栏遮罩：手机布局下由 JS 控制显示 */
.hz-is-mobile .fixed.inset-0.bg-black\/50 {
  display: none;
}
/* 看板：2 列卡片、1 列图表 */
.hz-is-mobile .hz-stat-grid {
  grid-template-columns: repeat(2, 1fr) !important;
}
.hz-is-mobile .hz-chart-grid {
  grid-template-columns: 1fr !important;
}
/* 主内容区占满宽度，禁止横向溢出 */
.hz-is-mobile main {
  width: 100% !important;
  max-width: 100% !important;
}
.hz-is-mobile, .hz-is-mobile body {
  overflow-x: hidden !important;
}
/* ============================================================
   季节主题：登录页/主界面岳麓山四季天气背景
   ============================================================ */

/* 登录页岳麓山四季天气背景 */
.login-festival-bg.hz-login-yd {
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-color: #1f2937 !important;
}
.login-festival-bg.hz-login-yd::before {
  content: "";
  position: fixed;
  inset: 0;
  background: linear-gradient(120deg, rgba(15,23,42,0.42) 0%, rgba(15,23,42,0.16) 45%, rgba(15,23,42,0.34) 100%);
  pointer-events: none;
}
.login-festival-bg.hz-login-yd > div { position: relative; z-index: 1; }

/* 春节倒计时卡片 */
.hz-cny-count {
  background: linear-gradient(135deg, rgba(255,248,235,0.96), rgba(255,238,214,0.96));
  border: 1px solid rgba(214,164,90,0.55);
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 16px;
  text-align: center;
  box-shadow: 0 6px 18px rgba(120, 20, 20, 0.18);
}
.hz-cny-label { font-size: 13px; color: #8a5a2b; }
.hz-cny-days { margin: 4px 0 2px; }
.hz-cny-days .num {
  font-size: 34px; font-weight: 800; color: #c0392b; line-height: 1.1;
}
.hz-cny-days .unit { font-size: 15px; color: #c0392b; margin-left: 4px; }
.hz-cny-date { font-size: 11px; color: #a07a55; }

/* 主界面季节横幅 */
.hz-season-banner {
  position: relative;
  width: 100%;
  border-radius: 14px;
  margin-bottom: 16px;
  background-size: cover;
  background-position: center;
  overflow: hidden;
  min-height: 132px;
  border: 1px solid #e8edf5;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}
.hz-season-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(15,23,42,0.55) 0%, rgba(15,23,42,0.28) 45%, rgba(15,23,42,0.05) 100%);
}
.hz-sb-inner {
  position: relative;
  z-index: 1;
  padding: 18px 22px;
  color: #fff;
  max-width: 60%;
}
.hz-sb-tag {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 1px;
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 999px;
  padding: 2px 10px;
  margin-bottom: 8px;
}
.hz-sb-title { font-size: 24px; font-weight: 800; line-height: 1.2; }
.hz-sb-title .hz-temp { font-size: 22px; font-weight: 700; }
.hz-sb-desc { font-size: 12.5px; margin-top: 6px; color: rgba(255,255,255,0.9); line-height: 1.5; }
.hz-sb-meta { font-size: 11.5px; margin-top: 8px; color: rgba(255,255,255,0.78); }

/* 横幅手机适配：文字区放宽，避免遮挡 */
@media (max-width: 640px) {
  .hz-season-banner { min-height: 118px; border-radius: 12px; }
  .hz-season-banner::before {
    background: linear-gradient(180deg, rgba(15,23,42,0.25) 0%, rgba(15,23,42,0.62) 100%);
  }
  .hz-sb-inner { max-width: 100%; padding: 14px 16px; }
  .hz-sb-title { font-size: 20px; }
  .hz-sb-title .hz-temp { font-size: 18px; }
  .hz-cny-days .num { font-size: 28px; }
}

/* 手机端原始统计网格、快捷入口统一单列 */
.hz-is-mobile .grid.grid-cols-1.sm\:grid-cols-2.lg\:grid-cols-4,
.hz-is-mobile .grid.grid-cols-1.lg\:grid-cols-3 {
  grid-template-columns: 1fr !important;
}

/* ============================================================
   角色头像系统
   ============================================================ */
.hz-avatar-circle { cursor: pointer; position: relative; transition: box-shadow .15s ease, transform .15s ease; }
.hz-avatar-circle:hover { box-shadow: 0 0 0 3px rgba(37,99,235,.25); transform: translateY(-1px); }

.hz-av-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(15,23,42,.5);
  display: none; align-items: center; justify-content: center;
  padding: 16px;
}
.hz-av-overlay.hz-av-show { display: flex; }
.hz-av-dialog {
  width: 100%; max-width: 460px; max-height: 88vh; overflow: hidden;
  background: #fff; border-radius: 14px;
  box-shadow: 0 20px 50px rgba(15,23,42,.28);
  display: flex; flex-direction: column;
  animation: hzAvPop .18s ease;
}
@keyframes hzAvPop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.hz-av-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid #eef1f5;
}
.hz-av-title { font-size: 16px; font-weight: 700; color: #1e293b; }
.hz-av-close {
  border: none; background: transparent; font-size: 22px; line-height: 1;
  color: #94a3b8; cursor: pointer; padding: 2px 6px; border-radius: 6px;
}
.hz-av-close:hover { background: #f1f5f9; color: #475569; }
.hz-av-body { padding: 18px 20px; overflow-y: auto; }
.hz-av-section-label {
  font-size: 13px; font-weight: 600; color: #475569; margin-bottom: 10px;
}
.hz-av-section-label:not(:first-child) { margin-top: 20px; }
.hz-av-upload { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hz-av-upload-btn {
  border: 1px solid #2563eb; background: #2563eb; color: #fff;
  font-size: 13px; font-weight: 600; padding: 8px 16px; border-radius: 8px;
  cursor: pointer; transition: background .15s ease;
}
.hz-av-upload-btn:hover { background: #1d4ed8; }
.hz-av-upload-btn:disabled { background: #93b4f5; border-color: #93b4f5; cursor: default; }
.hz-av-tip { font-size: 12px; color: #94a3b8; }

.hz-av-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px;
}
.hz-av-item {
  border: 2px solid transparent; background: #f8fafc; border-radius: 10px;
  padding: 0; cursor: pointer; overflow: hidden; aspect-ratio: 1 / 1;
  transition: border-color .15s ease, transform .15s ease;
}
.hz-av-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hz-av-item:hover { border-color: #93b4f5; transform: translateY(-2px); }
.hz-av-item.hz-av-selected { border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37,99,235,.2); }
.hz-av-item.hz-av-busy { opacity: .55; pointer-events: none; }

@media (max-width: 480px) {
  .hz-av-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .hz-av-dialog { max-height: 92vh; }
}

/* ============================================================
   瀚思教育 OA · 界面布局与合理性升级 (2026-11-11)
   追加式样式：不覆盖既有主题/热补丁，仅在末层做统一与增强
   ============================================================ */

/* ---------- 1. 全局排版与可读性 ---------- */
:root {
  --hz-ink: #1e293b;
  --hz-muted: #64748b;
  --hz-line: #e6ebf3;
  --hz-brand: #2563eb;
  --hz-brand-soft: #eff5ff;
  --hz-radius: 12px;
  --hz-shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --hz-shadow-md: 0 4px 16px rgba(15, 23, 42, .07);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Hiragino Sans GB", sans-serif !important;
  -webkit-font-smoothing: antialiased;
  color: var(--hz-ink);
}

/* 统一滚动条，避免内外穿透与宽表格出现双层滚动条 */
* { scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: #94a3b8; background-clip: padding-box; }

/* ---------- 2. 卡片层次与间距 ---------- */
main .rounded-xl,
main .rounded-lg {
  border-radius: var(--hz-radius) !important;
  box-shadow: var(--hz-shadow-md) !important;
  border-color: var(--hz-line) !important;
  transition: box-shadow .2s ease, border-color .2s ease;
}
main .rounded-xl:hover,
main .rounded-lg:hover { box-shadow: 0 6px 22px rgba(15, 23, 42, .10) !important; }

/* 卡片内的标题与描述层级 */
main h1, main h2, main h3 { letter-spacing: -.01em; }
main .text-slate-500, main .text-muted-foreground { color: var(--hz-muted) !important; }

/* ---------- 3. 筛选区：控件高度、间距、换行 ---------- */
main .flex.flex-wrap.items-center.gap-2,
main .flex.flex-wrap.gap-2,
main .flex.items-center.gap-2.flex-wrap { row-gap: 10px !important; }
main input:not([type="checkbox"]):not([type="radio"]),
main select,
main button.h-9,
main [role="combobox"] {
  min-height: 36px;
  border-radius: 8px !important;
}
main input:not([type="checkbox"]):not([type="radio"]):focus,
main select:focus,
main [role="combobox"]:focus-visible {
  outline: none !important;
  border-color: var(--hz-brand) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .14) !important;
}
main input::placeholder { color: #a5b0c2 !important; }

/* ---------- 4. 表格：表头、斑马纹、悬停、粘性表头 ---------- */
main table { border-collapse: separate !important; border-spacing: 0; }
main thead th,
main .ant-table-thead > tr > th {
  background: #f7f9fd !important;
  color: #475569 !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  border-bottom: 1px solid var(--hz-line) !important;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
}
main tbody td,
main .ant-table-tbody > tr > td {
  border-bottom: 1px solid #f0f3f8 !important;
  padding-top: 10px !important;
  padding-bottom: 10px !important;
  font-size: 13px;
  vertical-align: middle;
}
main tbody tr:nth-child(even),
main .ant-table-tbody > tr:nth-child(even) > td { background: #fcfdff !important; }
main tbody tr:hover > td,
main .ant-table-tbody > tr:hover > td { background: var(--hz-brand-soft) !important; }
main tbody tr { transition: background-color .15s ease; }

/* 表格行内按钮收紧，减少操作列挤压 */
main tbody button.h-7 { padding-left: 6px !important; padding-right: 6px !important; }

/* ---------- 5. 按钮与标签 ---------- */
main button:not(:disabled) { transition: transform .12s ease, box-shadow .15s ease, background-color .15s ease; }
main button:not(:disabled):active { transform: translateY(1px); }
main button:disabled { opacity: .55 !important; cursor: not-allowed !important; }
main .bg-red-600, main .bg-destructive { box-shadow: 0 2px 8px rgba(200, 16, 46, .18); }
main .bg-green-600 { box-shadow: 0 2px 8px rgba(22, 163, 74, .18); }

/* ---------- 6. 弹窗与遮罩 ---------- */
[role="dialog"],
.hz-av-dialog {
  border-radius: 14px !important;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .24) !important;
}
[role="dialog"] h2, [role="dialog"] [id$="-title"] { font-weight: 650 !important; }

/* ---------- 7. 侧边栏：分组留白与当前项可辨识度 ---------- */
aside nav a { border-radius: 8px !important; margin: 1px 6px !important; transition: background-color .15s ease, color .15s ease; }
aside nav a.bg-blue-50 { border-radius: 8px !important; }
aside nav { scrollbar-width: thin; }
aside .text-slate-800 { color: #f1f5f9 !important; }

/* ---------- 8. 空状态与加载 ---------- */
main [class*="text-center"][class*="text-slate-4"] { color: #94a3b8 !important; }

/* ---------- 9. 移动端合理性 ---------- */
@media (max-width: 1023px) {
  /* 筛选区改为两列自适应，避免控件被挤成一条细线 */
  main .flex.flex-wrap.items-center.gap-2 > *,
  main .flex.flex-wrap.gap-2 > * { flex: 1 1 140px !important; min-width: 0; }
  main .flex.flex-wrap.items-center.gap-2 > button,
  main .flex.flex-wrap.gap-2 > button { flex: 1 1 100px !important; }
  /* 触控目标不小于 40px */
  main button { min-height: 40px; }
  /* 弹窗留安全边距 */
  [role="dialog"] { max-width: calc(100vw - 24px) !important; max-height: calc(100vh - 24px) !important; overflow-y: auto; }
  /* 顶部标题不换行溢出 */
  header h1, header .font-semibold { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* ---------- 10. 无障碍：减少动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
