/* static/css/custom.css - Cleaned and updated with new color scheme */

/* --- Ensure custom-fonts.css is linked in base.html to define @font-face rules --- */
/* Link in base.html BEFORE theme CSS: <link rel="stylesheet" href="{% static 'css/custom-fonts.css' %}" /> */
/* --- Ensure custom.css is linked in base.html AFTER theme CSS --- */
/* Link in base.html AFTER theme CSS: <link rel="stylesheet" href="{% static 'css/custom.css' %}" /> */


/* === Global Settings === */

/* Apply base font family, size, line height, default text color, and background color */
body {
    font-family: "思源宋体 Light", "思源宋体", serif;
    font-size: 16px; /* 常规基础字体大小 */
    line-height: 1.6;
    color: #383A3F; /* <-- 设置所有文字的默认颜色为 #383A3F */
    background-color: #1F2124; /* <-- 设置页面主背景色为 #1F2124 */
}

/* Set sidebar background color */
.sidenav { /* Assumes your sidebar has the class 'sidenav' */
    background-color: #252c41 !important; /* <-- 设置侧边栏背景色与主背景一致 */
}


/* === Typography Settings === */

/* Apply heading font family, sizes, and spacing (钉钉进步体) */
h1, h2, h3, h4, h5, h6 {
    font-family: "钉钉进步体", sans-serif;
    /* font-weight: ...; */ /* 调整字重 */
    line-height: 1.2;
    margin-top: 0.8em;
    margin-bottom: 0.4em;
    /* 标题颜色通常继承自 body，如果需要单独设置，可以在这里 */
    /* color: #383A3F; */
}

/* Ensure card titles also use heading font */
.card-title {
     font-family: "钉钉进步体", sans-serif;
     /* font-size: 1.1rem; */ /* 可选：调整大小 */
     /* color: #383A3F; */ /* 继承或单独设置 */
}

/* Ensure other common text elements inherit base font family */
p, span, div, td, th, li {
     font-family: inherit; /* 继承字体 */
     /* color: inherit; */ /* 继承颜色 */
}

/* Adjust font size/family for very small text elements like .text-xxs if needed */
.text-xxs {
    /* font-size: 0.75rem !important; */ /* 保持主题xxs大小或覆盖 */
    font-family: inherit !important; /* 确保继承字体族 */
    /* color: inherit !important; */ /* 如果需要确保颜色继承 */
}



/* === Hyperlink Styles === */

/* Default link style */
a {
    color: #F6B352 !important; /* <-- 设置超链接默认颜色为 #F6B352 */
    text-decoration: none; /* 移除下划线 */
    transition: color 0.3s ease-in-out; /* 添加颜色过渡效果 */
}

/* Link hover style */
a:hover {
    color: #F68657 !important; /* <-- 设置超链接悬停颜色为 #F68657 */
    text-decoration: none; /* 确保悬停时也没有下划线 */
}

/* Override colors for links with color utility classes (like text-primary etc.) */
/* 强制带有颜色工具类的链接使用我们设置的默认链接颜色 #F6B352 */
a.text-primary, a.text-secondary, a.text-info, a.text-warning, a.text-danger, a.text-success, a.text-light, a.text-dark, a.text-muted {
    color: #F6B352 !important; /* <-- 强制颜色为 #F6B352 */
}

/* Optional: Style links in specific contexts differently */
/* 例如：侧边栏链接颜色可以不同 */
/* .sidebar a { color: var(--bs-white) !important; } */
/* .sidebar a:hover { color: #ccc !important; } */


/* === Card Styles === */

/* Set card background color */
.card {
    background-color: #F8FAFF; /* <-- 设置卡片背景色为 #383A3F */
    /* Optional: Adjust border color if needed */
    /* border-color: #555; */
}

.card .table tbody tr {
    background-color: #F8FAFF; /* <-- 示例：设置表格行为白色 */
    /* 你可以将这里的 #ffffff 替换为你想要的颜色代码 */
    /* border-bottom: 1px solid #eee; /* 可选：为行之间添加浅灰色边框 */
}

/* Reduce padding for card headers */
.card .card-header {
    padding: 10px 10px 0 10px;
    background-color: transparent; /* Make header background transparent to use card background */
    border-bottom: none; /* Remove default header border */
}

/* Adjust padding for card body */
.card .card-body {
    padding: 10px 12px 12px 12px;
}


/* === Table Styles === */
/* 目标是卡片 (.card) 内部表格 (.table) 的表头 (th) */
.card .table th {
    background-color: #F8FAFF; /* <-- 设置背景颜色为 #383A3F (与卡片背景一致) */
    /* Optional: Add padding or adjust borders if needed */
    /* padding: 0.75rem; */
    /* border-bottom: none; /* 例如：移除底部边框 */
}
.card .table td {
    background-color: #F8FAFF; /* <-- 设置背景颜色为 #383A3F (与卡片背景一致) */
    /* Optional: Add padding or adjust borders if needed */
    /* padding: 0.75rem; */
    /* border-bottom: none; /* 例如：移除底部边框 */
}
/* Override styles for table headers (th) using utility classes */
.table th.text-xxs {
    font-size: 0.875rem !important; /* 14px */
    font-weight: bold !important; /* 粗体 */
    color: #F6B352 !important; /* <-- 设置表头文字颜色为 #F6B352 (强调色) */
    text-transform: none !important; /* 取消大写 */
    opacity: 1 !important; /* 完全不透明 */
    padding: 0.25rem !important; /* 内边距 */
        /* background-color: #f0f0f0; */
    /* border-bottom: 2px solid #555 !important; */
}

/* Reset font properties for table data (td) cells to browser initial defaults for font-family */
td {
    font-family: initial; /* 浏览器默认字体族 (通常是衬线) */
    /* font-size, font-weight 由内部元素控制 */
    /* color 继承自 body (#383A3F) */
}

/* Set font size and weight for utility classes WITHIN td */
td .text-xs {
    font-size: 1.2rem !important; /* 设置 td 内部文字大小 */
    /* color inherits from parent/body */
}

td .font-weight-bold {
    font-weight: normal !important; /* 设置 td 内部文字粗细 */
    /* color inherits from parent/body */
}

/* Ensure text color inside td inherits from td or parent if utility classes are used */
td .text-secondary {
     color: inherit !important; /* 确保颜色继承自 td (即 #383A3F) */
}


/* === Navigation Bar Icon Styles === */

/* Customize navigation bar icon element (i) */
.nav-link .icon i.iconfont {
    font-size: 1.6rem !important; /* 图标大小 */
    color: #F6B352 !important; /* <-- 设置图标默认颜色为 #F6B352 */
    opacity: 1 !important; /* 不透明度 */
    padding: 2px !important; /* 图标内边距 */
    /* vertical-align: middle !important; */ /* 垂直对齐 */
}

/* Customize icon container (div.icon) */
.nav-link .icon {
    width: 46px !important;
    height: 46px !important;
    background-color: transparent !important; /* <-- 图标容器背景透明，让选中时的背景更明显 */
    /* border-radius: 8px !important; */ /* 圆角 */
    /* box-shadow: none !important; */ /* 阴影 */
    margin-right: 4px !important; /* 容器右外边距 */
}

/* Navigation link hover state icon style */
.nav-link:hover .icon i.iconfont {
    color: #F68657 !important; /* <-- 设置图标悬停颜色为 #F68667 */
    transform: scale(1.2); /* 悬停放大 */
    transition: transform 0.5s ease-in-out;
}

/* Navigation link active state icon container background color */
.nav-link.active .icon {
    background-color: #F68657 !important; /* <-- 设置活动状态容器背景为 #F68657 */
    font-weight: normal !important; /* 将字重设置为 normal (正常) */
    /* 你也可以使用其他颜色，比如 #ffffff 或 #fff */
    /* Optional: Change icon color when active */
    /* .nav-link.active .icon i.iconfont { color: white !important; } */ /* 如果需要图标在橘红色背景上变白 */
}
.nav-link.active .icon i.iconfont { /* <-- 找到这个规则 */
    color: white !important; /* <-- 确保这一行存在并且没有被注释掉 (即前面没有 /* 或 //) */
    /* 你也可以使用其他颜色，比如 #ffffff 或 #fff */
    transform: scale(1.2); /* <-- 添加这一行，使图标放大 1.2 倍 */
}

/* If active class is on nav-item (li) */
/* .nav-item.active .icon { background-color: #F68657 !important; } */


/* === Other Custom Overrides === */
/* 在这里添加其他你需要覆盖或自定义的 CSS 规则 */
/* 例如，调整主内容区域的 padding */
/* .main-content { padding-left: 15px; padding-right: 15px; } */ /* 示例，如果 container-fluid 未用 */

/* 设置到期提醒徽章颜色 */
.badge.bg-gradient-warning { /* 即将到期徽章 */
    background-image: none !important; /* 移除渐变 */
    background-color: #F6B352 !important; /* 设置背景色为柔和橙色 */
    color: #1F2124 !important; /* 设置文字颜色为最深的灰色 */
}

.badge.bg-gradient-danger { /* 已逾期徽章 */
    background-image: none !important; /* 移除渐变 */
    background-color: #F68657 !important; /* 设置背景色为鲜艳橙红色 */
    color: #1F2124 !important; /* 设置文字颜色为最深的灰色 */
}

/* === 设置首页顶部公告容器的特定内边距 === */
/* 针对 home.html 中包裹 home_top_banner 的 div 添加的独有类 */
.home-banner-container {
    /* 设置所需的内边距值：顶部 24px，右侧 12px，底部 0，左侧 12px */
    padding: 24px 12px 0 12px !important;

    /* 这个元素仍然有 container-fluid 和 py-4 类 */
    /* 但这个规则会覆盖它们设置的 padding 值 */
}

/* ... 其他自定义 CSS 覆盖 ... */


.sidenav-header {
    text-align: center; /* 文本居中，有助于内部图片或链接居中 */
    padding-top: 20px; /* 顶部内边距，与侧边栏顶部留白 */
    padding-bottom: 20px; /* 底部内边距，与下方内容留白 */
    /* 根据你的主题默认样式，可能需要调整这些 padding 值 */
}

/* === 样式化 sidenav-header 中的 Logo 图片 === */
.sidenav-header img {
    max-width: 100% !important; /* 重要：设置最大宽度为父容器的 100%，确保图片不会溢出侧边栏 */
    height: 150px !important;    /* 重要：高度自动，保持图片的原始宽高比例，避免变形 */
    display: block;  /* 让图片变为块级元素，以便使用自动外边距进行居中 */
    margin: 0 auto;  /* 上下外边距为 0，左右外边距自动，实现水平居中 */
    margin-bottom: 25px; /* 在图片下方添加外边距，与下方菜单拉开距离 */
    /* 如果图片原始尺寸特别大，或者主题有强力的样式覆盖，可能需要以下规则 */
    /* width: auto !important; */
    /* height: auto !important; */
}

.sidenav hr {
     margin-top: 10px !important; /* 例如，设置顶部 margin */
     margin-bottom: 100px !important; /* 例如，设置底部 margin */

}
.badge {
    /* 将字体大小增加，例如设置为 1rem (这会使字体大小等于根元素的字体大小，通常是 16px) */
    /* 你可以根据需要调整 1rem 这个值，比如 1.1rem, 1.2rem 等 */
    --bs-badge-font-size: 0.85rem !important; /* <-- 修改这个值 */

    /* 徽章的 padding 使用 em 单位，会随着字体大小的改变自动缩放 */
    /* 如果你对自动缩放后的 padding 不满意，也可以在这里覆盖 padding 的变量 */
    /*
    --bs-badge-padding-x: 0.8em !important; /* 示例：增加水平内边距 */
    --bs-badge-padding-y: 0.4em !important; /* 示例：增加垂直内边距 */
    */
}