/* 导入字体 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

/* 基础样式 */
body {
    font-family: 'Noto Sans SC', sans-serif;
    background-color: #0f172a;
    color: #f8fafc;
    overflow-x: hidden;
    line-height: 1.5;
    margin: 0;
    padding: 0;
    transition: padding-top 0.3s ease-in-out;
}

/* 主容器 - 添加过渡效果与导航栏联动 */
main {
    transition: padding-top 0.3s ease-in-out;
}

/* 内页标题和菜单区域样式 */
.page-header, .page-menu, .section-header {
    padding-top: 5px; /* 内页顶部元素增加内边距 */
    margin-top: 10px; /* 增加与顶部的间距 */
    position: relative;
    z-index: 10; /* 确保在适当的层级 */
}

/* 为内页菜单设置安全距离，避免与导航栏重叠 */
.page-menu {
    margin-top: 15px;
    border-radius: 8px;
    overflow: hidden;
}

/* 内页标题固定定位时的样式，确保不与导航栏重叠 */
.page-header.sticky-top, .page-menu.sticky-top {
    position: sticky;
    top: 15px; /* 与隐藏的导航栏保持距离 */
    background-color: #0f172a;
    z-index: 20;
    padding: 10px 0;
    transition: top 0.3s ease-in-out;
}

/* 通用效果 */
.glow {
    box-shadow: 0 0 15px rgba(14, 165, 233, 0.5);
}

.glass {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 动画效果 */
@keyframes pulse {
    0% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.8;
    }
}

.animate-pulse {
    animation: pulse 2s infinite;
}

/* 数据可视化图表样式 */
.chart-container {
    width: 100%;
    height: 100%;
    position: relative;
}

/* 表格样式 */
.table-container {
    width: 100%;
    overflow-x: auto;
}

/* 响应式调整 */
@media (max-width: 1024px) {
    .grid-cols-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    
    .grid-cols-3 {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .grid-cols-2 {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
    
    nav .flex.items-center.space-x-8 {
        display: none;
    }
    
    /* 添加移动端菜单按钮 */
    .mobile-menu-btn {
        display: block !important;
    }
}

/* 主题色变量 */
:root {
    --primary-color: #0ea5e9;
    --secondary-color: #7c3aed;
    --dark-color: #0f172a;
    --light-color: #f8fafc;
    --success-color: #4ade80;
    --warning-color: #facc15;
    --error-color: #ef4444;
}

/* 加载状态样式 */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.loading::before {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    border: 4px solid #0ea5e9;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    z-index: 101;
    top: calc(50% - 20px);
    left: calc(50% - 20px);
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* 日期选择器样式 */
.flatpickr-calendar {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

/* 月份和年份区域样式 */
.flatpickr-months {
    padding: 10px 0;
    background: #0c1425;
    border-bottom: 2px solid #0ea5e9;
}

.flatpickr-months .flatpickr-month {
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flatpickr-current-month {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    height: 100%;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
    font-size: 1.2rem;
    font-weight: bold;
    color: #ffffff;
    background: transparent;
    border: none;
    padding: 0 5px;
    text-shadow: 0 0 4px rgba(14, 165, 233, 0.6);
}

.flatpickr-current-month .numInputWrapper {
    height: auto;
    display: flex;
    align-items: center;
}

.flatpickr-current-month input.cur-year {
    font-size: 1.2rem;
    font-weight: bold;
    color: #ffffff;
    padding: 0;
    text-shadow: 0 0 4px rgba(14, 165, 233, 0.6);
}

.flatpickr-months .flatpickr-prev-month, 
.flatpickr-months .flatpickr-next-month {
    color: #0ea5e9;
    fill: #0ea5e9;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 46px;
}

.flatpickr-months .flatpickr-prev-month:hover, 
.flatpickr-months .flatpickr-next-month:hover {
    color: #38bdf8;
    fill: #38bdf8;
}

/* 日期选择图标和弹出指示器 */
.flatpickr-input + .icon,
.flatpickr-calendar:after, 
.flatpickr-calendar:before {
    display: none !important; /* 完全移除所有三角形 */
}

/* 日期输入框样式调整 */
input.flatpickr-input {
    background-color: #1e293b !important;
    color: white !important;
    border-radius: 6px !important;
    padding: 8px 12px 8px 36px !important; /* 增加左内边距，为图标留出空间 */
}

/* 输入框内图标位置修复 */
.flatpickr-wrapper {
    position: relative;
}

.flatpickr-wrapper:before {
    content: "\f133"; /* 日历图标 Unicode (使用Font Awesome) */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #0ea5e9;
    z-index: 10;
    pointer-events: none; /* 确保图标不会干扰输入框交互 */
}

/* 星期标题区域 */
.flatpickr-weekdays {
    background: #0c1425;
    height: 46px;
    display: flex;
    align-items: center;
    padding: 6px 0;
    border-bottom: 3px solid #0ea5e9;
    margin-bottom: 5px;
}

.flatpickr-weekday {
    background: transparent;
    color: #38bdf8 !important;
    font-weight: 700;
    font-size: 1.15rem;
    opacity: 1;
    height: auto;
    line-height: 1.5;
    text-shadow: 0 0 5px rgba(14, 165, 233, 0.9);
    letter-spacing: 1px;
}

.flatpickr-day {
    color: #ffffff;
    background: #334155;
    border-radius: 4px;
    margin: 2px;
    height: 36px;
    line-height: 36px;
}

.flatpickr-day.selected, 
.flatpickr-day.startRange, 
.flatpickr-day.endRange {
    background: #0ea5e9;
    border-color: #0ea5e9;
    color: #ffffff;
    font-weight: bold;
}

.flatpickr-day:hover {
    background: #475569;
}

.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
    color: #94a3b8;
}

.flatpickr-day.flatpickr-disabled, 
.flatpickr-day.flatpickr-disabled:hover {
    color: #475569;
    background: #1e293b;
}

/* 年份上下切换箭头位置调整 */
.numInputWrapper span.arrowUp,
.numInputWrapper span.arrowDown {
    /* background-color: #0ca3e6; */
    border: none !important;
    width: 24px !important;
    height: 20px !important; /* 减小高度 */
    padding: 0 !important;
    opacity: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    right: -28px !important; /* 将箭头移到年份输入框右侧 */
}

.numInputWrapper span.arrowUp {
    top: -1px !important;
}

.numInputWrapper span.arrowDown {
    top: 20px !important; /* 调整下箭头位置 */
}

/* 确保年份输入框有合适的右边距，为箭头腾出空间 */
.flatpickr-current-month .numInputWrapper input {
    min-width: 60px !important;
    text-align: center !important;
    padding-right: 5px !important;
}

/* === 导航栏样式 === */
nav {
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* 导航栏滚动触发器 - 顶部区域，用于触发导航栏显示 */
.nav-trigger-area {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 10px;
    z-index: 40;
} 