/* 主�局样式 */
/* 登录容器 */
/* 登录表单 */
/* 侧边列表栏 */
/*反馈文本*/



* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f0f2f5;
}

.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.login-logo {
    text-align: center;
    margin-bottom: 20px;
}

.login-logo img {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(6, 122, 175, 0.3);
}

.login-container h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

button {
    width: 100%;
    padding: 10px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

button:hover {
    background-color: #45a049;
}

#login-message {/*登录反馈文本*/
    margin-top: 15px;
    text-align: center;
    color: red;
}

.dashboard {
    display: flex;  /*弹性布局*/
    flex-direction: column; /*行方向*/
    height: 100vh;/* /*高度*/
}

.sidebar {
    max-width: 100%;
    background: linear-gradient(90deg, #067aaf 0%, #0a9dc7 100%);
    color: rgb(247, 245, 245);
    padding: 8px 20px;
    position: relative;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.sidebar-brand img {
    width: 30px;
    height: 30px;
    border-radius: 6px;
}

.sidebar-brand h2 {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    white-space: nowrap;
}

.sidebar h3 {
    margin-bottom:5px;
    margin-left: 10px;
   
}

.sidebar-nav {
    flex: 1;
    display: flex;
}

.sidebar ul {
    list-style: none;/*无列表样式*/
    padding: 0;
    display: flex;   
    flex-direction: row;
    margin: 0;

}

.sidebar ul li {
    margin-bottom: 5px;
    flex-direction: row;

}

.sidebar ul li a {
    color: white;
    text-decoration: none;/*无下划线*/
    display: block;
    padding: 8px 12px;
    border-radius: 4px; 
    font-weight: bold;
    font-size: 13px;
    
}

.sidebar ul li a:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.sidebar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 13px;
}

.sidebar-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.sidebar-user-name {
    font-weight: 500;
}

.sidebar-btn {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.sidebar-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.sidebar-btn.logout-btn {
    background: rgba(239, 83, 80, 0.8);
    border-color: rgba(239, 83, 80, 0.9);
}

.sidebar-btn.logout-btn:hover {
    background: rgba(239, 83, 80, 0.95);
}
.menu-container {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    flex: 1;
}
#user_info:hover,#logout_button:hover {
   background-color: #afe9f4;
    color: rgb(21, 12, 0);
    font-weight: bold;
}


.menu-item {
    margin-top: 10px;
}

.menu-title {
    display: block;
    padding: 8px 12px;
    font-weight: bold;
    color: #ccc;
    cursor: pointer;
    position: relative;
}

.menu-title::after {/*下拉箭头*/
    content: '▼';
    position: absolute;
    right: 12px;
    font-size: 10px;
    transition: transform 0.3s;
}

/*.menu-title.expanded::after {
    transform: rotate(180deg);/*旋转*/
/*}*/

.sub-menu {
    margin-left: 20px;
    margin-top: 5px;
    display: none;
}

.sub-menu.show {
    display: block;
}

.sub-menu li {
    margin-bottom: 3px;
}

.sub-menu li a {
    padding: 6px 12px;
    font-size: 14px;
}

.content {
    flex: 1;/*自适应宽度*/
    padding: 2px 10px 10px 10px;
    overflow-y: auto;/*自动滚动条*/  
    margin-top: 3px; 
}

.content h2 {
    margin-bottom: 20px;
}
.index-card {
    background-color: white;
    padding: 5px;/*内边距*/
    border-radius: 8px; /*圆角*/
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);/*阴影*/
    margin-bottom: 2px;/*外边距*/
    height: 12%;
}

.card {
    background-color: white;
    padding: 11px;/*内边距*/
    border-radius: 8px; /*圆角*/
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);/*阴影*/
    margin-bottom: 5px;/*外边距*/
}
.submit-container{
    max-height: 130px;/*最大高度*/
    height: 120px;/*自动高度*/
    border-radius: 8px;/*圆角*/
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);/*阴影*/
    margin-bottom: 10px;/*外边距*/
    background-color: white;
    display: flex;  

    /*align-items: flex-end;*/
}
.submit-container textarea {
    width:85%;
    height: 80%;
    align-self: flex-start;/*左对齐*/
    background-color: white;/*背景颜色*/
    padding: 10px;/*内边距*/
    border-radius: 8px; /*圆角*/
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);/*阴影*/
    margin-top: 15px;/*外边距*/
    margin-bottom: 15px;
    margin-left: 10px;
    min-height: 40px;/*最小高度*/
    max-height: 100px;/*最大高度，不超过容器*/
    /*height: auto;/*自动高度*/
    font-size: 13px;/*字体大小*/
    resize: none;/*禁止手动调整大小*/
    overflow-y: auto;/*垂直滚动*/
}

.submit-container button {
    width: 85%;
   /* height: 85%;*/
    background-color: gray;
    /*align-self: flex-end;*/
    display: auto;/*自动布局*/
    gap: 30px;
    align-self: flex-end;/*右对齐*/   
    padding: 10px 20px;/*内边距*/
    margin-top: 15px;/*外边距*/
    margin-bottom: 10px;/*外边距*/
    margin-right: 10px;/*右外边距*/
    margin-left: 10px;/*左外边距*/
    border-radius: 8px;/*圆角*/
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);/*阴影*/
    /* flex-direction: column !important; */
    font-size: clamp(10px, 1.2vw, 14px);/*字体大小*/
    font-family: '微软雅黑';/*字体*/
    font-weight: bold;/*字体加粗*/  
    justify-content: center;  /* 水平居中 */
    align-items: center;      /* 垂直居中 */
    

}
.submit-container button:hover {
    background-color: #4CAF50;
    color: white;
}

.content h2 {
    margin-bottom: 15px;
    font-size: 24px;
}

.content h3 {
    margin-bottom: 15px;
    font-size: 15px;
}


.chart-container {
    max-height: 300px;
    margin-top: 20px;
}


.stats {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

.stat-item {
    flex: 1;
    text-align: center;
    padding: 1px;
    background-color: #f9f9fa;
    border-radius: 5px;
    max-height: 10%;
    max-width: 80%;
}


.stat-item h4 {
    margin-bottom:10px;
    color: #404042;
}

.stat-item p {
    font-size:13px;
    font-weight: bold;
    color: #333;
}

.multi-select-container {
    position: relative;
    width: 100%;
}

.multi-select-input {
    padding: 9px 14px 9px 14px;
    border: 1.5px solid #94a3b8;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    background-color: #ffffff;
    width: 100%;
    min-height: 38px;
    text-align: left;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    color: #1e293b;
    box-sizing: border-box;
}

.multi-select-input:hover {
    border-color: #64748b;
}

.multi-select-input:focus {
    outline: none;
    border-color: #0369a1;
    box-shadow: 0 0 0 3px rgba(3, 105, 161, 0.18);
    background-color: #fff;
}

.multi-select-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15), 0 2px 6px rgba(0, 0, 0, 0.08);
    margin-top: 0;
    animation: dropdownFadeIn 0.2s ease-out;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.multi-select-dropdown.show {
    display: block;
}

.search-input {
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 10px 10px 0 0;
    font-size: 13px;
    outline: none;
    background-color: #f1f5f9;
    transition: background-color 0.2s;
    box-sizing: border-box;
}

.search-input:focus {
    background-color: white;
}

.options-wrapper {
    max-height: 240px;
    overflow-y: auto;
    padding: 4px 0;
}

.options-wrapper::-webkit-scrollbar {
    width: 6px;
}

.options-wrapper::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 3px;
}

.options-wrapper::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 3px;
}

.options-wrapper::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

.multi-select-dropdown label {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.15s ease;
    border-bottom: 1px solid #f1f5f9;
    color: #1e293b;
}

.multi-select-dropdown label:last-child {
    border-bottom: none;
}

.multi-select-dropdown label:hover {
    background-color: #e0f2fe;
}

.multi-select-dropdown label.selected {
    background-color: #bae6fd;
    color: #0c4a6e;
}

.multi-select-dropdown input[type="checkbox"] {
    margin-right: 12px;
    max-width: 16px;
    max-height: 16px;
    cursor: pointer;
    accent-color: #0369a1;
}

.no-results {
    padding: 20px 16px;
    text-align: center;
    color: #64748b;
    font-size: 13px;
}

/* 全选样式 */
.select-all {
    background-color: #e0f2fe;
    font-weight: 600;
    border-bottom: 2px solid #0369a1;
    color: #0c4a6e;
}

.select-all:hover {
    background-color: #bae6fd;
}

/* 标签容器样式 */
.multi-select-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 6px 2px 0 2px;
    max-height: 72px;
    overflow-y: auto;
}

.selected-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
    max-width: 100%;
    max-height: 72px;
    overflow-y: auto;
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px 4px 12px;
    background: linear-gradient(135deg, #0369a1 0%, #0284c7 100%);
    color: white;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    gap: 6px;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(3, 105, 161, 0.25);
    transition: all 0.2s ease;
}

.tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(3, 105, 161, 0.35);
}

.tag .close-btn {
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
    font-weight: 400;
}

.tag .close-btn:hover {
    opacity: 1;
    color: #fff;
}


.positive {
    color: #28a745;
    font-weight: bold;
}

.negative {
    color: #dc3545;
    font-weight: bold;
}


/* 平板端适配 (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {

  .dashboard {      
        flex-direction: column;
    }
}

/* 手机端适配 (<768px) */
@media (max-width: 768px) {    
    .sidebar {
        max-width: 100%;
        padding: 0px;
        position: relative;
        font-size: 10px;
        max-height: 25%;
    }
    .sidebar ul {
        max-height: 30%;
        font-size: 8px;
    }
    
    .content {
        padding: 10px 5px;
        width: 100%;
    }
    .card {
        font-size: 6px;
    }
     .card h3{
        font-size: 10px;
    }
    .card p{
        font-size: 5px;
    }
    .filters {
        font-size: 8px;
    }
    .sub-menu li a {
    padding: 6px 12px;
    font-size: 6px;
    }
    .filter-item label {
    font-size: 6px;
    }
      .multi-select-input {
        width: 100%;       /* 全屏宽度 */
        max-width: 280px;  /* 最大宽度限制 */
        height: 35px;      /* 更大的点击区域 */
        padding: 10px 14px;
        font-size: 10px;   /* 更大的字体便于阅读 */
        box-sizing: border-box;/* 包含内边距和边框在宽度内 */
        gap: 7px;/* 选项之间的间距 */
    }
    .filter-item input[type="date"] {
        width: 100%;
        max-width: 280px;
        height: 35px;
        padding: 10px 14px;
        font-size: 13px;
        box-sizing: border-box;/* 包含内边距和边框在宽度内 */
        margin-bottom: 8px;    /* 下方间距 */
        margin-top: 4px;        /* 上方间距 */
    }

    /* 如果 filter-item 是 flex 容器，可以添加 gap */
    .filter-item {
        gap: 3px;  /* label 和 input 之间的间距 */
    }
    .filter-item .filter-button {
        width: 100%;
        margin-bottom: 8px;
        height: 35px;
        box-sizing: border-box;
        font-size: 13px;
        gap:10px;
    }


/* 平板适配 (768px - 1024px) */
@media (max-width: 1024px) {
    .dashboard {
        display: flex;
        flex-direction: column;
        
    }
    
    #bu-summary-grid .bu-card {
        min-width: 65px !important;
        padding: 5px !important;
    }
    
    #bu-summary-grid .bu-card .bu-name {
        font-size: 13px !important;
    }
    
    #bu-summary-grid .bu-card .bu-amount {
        font-size: 15px !important;
    }
    
    #bu-summary-grid .bu-card .bu-percent {
        font-size: 12px !important;
    }
}

/* 小屏手机适配 (<= 480px) */
@media (max-width: 480px) {
    /* sidebar 小屏手机适配 */
    .sidebar {
        padding: 8px !important;
        font-size: 9px !important;
        position: relative;
        height: auto;
        max-height: none;

    }  
    
    .sidebar ul{
        gap: 3px !important;
        font-size: 11px !important;
        margin-top: -3px !important;
        margin-bottom: -11px !important;
    }    

    #bu-summary-container {
        padding: 10px 15px !important;
    }
    
    #bu-summary-container h4 {
        font-size: 12px !important;
        margin-bottom: 10px !important;
    }
    
    #bu-summary-grid .bu-card {
        padding: 6px 4px !important;
    }
    
    #bu-summary-grid .bu-card .bu-name {
        font-size: 11px !important;
    }
    
    #bu-summary-grid .bu-card .bu-amount {
        font-size: 12px !important;
    }
    
    #bu-summary-grid .bu-card .bu-percent {
        font-size: 10px !important;
    }
}

/* ========== 手机端整体适配优化 ========== */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    
    .dashboard {
        min-height: 100vh;
    }
    
    /* 侧边栏 - 手机端 */
    .sidebar {
        padding: 8px 12px !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        max-height: none !important;
        font-size: 12px !important;
        position: sticky !important;
        top: 0;
        z-index: 100;
    }
    
    .sidebar-brand {
        gap: 6px;
        flex-shrink: 0;
    }
    
    .sidebar-brand img {
        width: 24px !important;
        height: 24px !important;
    }
    
    .sidebar-brand h2 {
        font-size: 13px !important;
    }
    
    /* 用户信息和退出按钮 - 靠右排列 */
    .sidebar-right {
        gap: 8px !important;
        margin-left: auto;
        flex-shrink: 0;
    }
    
    .sidebar-user {
        gap: 4px;
        font-size: 11px;
    }
    
    .sidebar-user-avatar {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
    
    .sidebar-user-name {
        font-size: 11px;
        max-width: 60px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .sidebar-btn {
        padding: 4px 10px !important;
        font-size: 11px !important;
    }
    
    /* 导航菜单 - 横向滚动 */
    .sidebar-nav {
        order: 3 !important;
        width: 100% !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch;
        max-height: none !important;
    }
    
    .sidebar-nav::-webkit-scrollbar {
        display: none;
    }
    
    .sidebar ul {
        flex-wrap: nowrap !important;
        gap: 6px !important;
        max-height: none !important;
        font-size: 12px !important;
        margin: 0 !important;
    }
    
    .sidebar ul li {
        margin-bottom: 0 !important;
        flex-shrink: 0;
    }
    
    .sidebar ul li a {
        padding: 8px 12px !important;
        font-size: 12px !important;
        white-space: nowrap;
    }
    
    /* 内容区域 */
    .content {
        padding: 12px 10px !important;
        width: 100% !important;
        box-sizing: border-box;
    }
    
    /* 卡片 */
    .card {
        font-size: 13px !important;
        padding: 12px !important;
    }
    
    .card h3 {
        font-size: 15px !important;
    }
    
    .card p {
        font-size: 12px !important;
    }
    
    /* 筛选器 */
    .filters {
        font-size: 12px !important;
        gap: 10px;
    }
    
    .filter-item label {
        font-size: 11px !important;
    }
    
    .multi-select-input {
        width: 100% !important;
        max-width: 100% !important;
        height: 38px !important;
        padding: 8px 12px !important;
        font-size: 12px !important;
    }
    
    .filter-item input[type="date"] {
        width: 100% !important;
        max-width: 100% !important;
        height: 38px !important;
        padding: 8px 12px !important;
        font-size: 12px !important;
    }
    
    .filter-item .filter-button {
        width: 100% !important;
        height: 38px !important;
        font-size: 13px !important;
    }
}

/* 小屏手机适配 (<= 480px) */
@media (max-width: 480px) {
    .sidebar {
        padding: 8px 10px !important;
        gap: 8px !important;
    }
    
    .sidebar-brand h2 {
        font-size: 13px !important;
    }
    
    .sidebar ul li a {
        padding: 6px 10px !important;
        font-size: 11px !important;
    }
    
    .sidebar-user-name {
        display: none;
    }
    
    .sidebar-btn {
        padding: 5px 10px !important;
        font-size: 11px !important;
    }
    
    .content {
        padding: 8px 6px !important;
    }
    
    .card {
        padding: 10px !important;
    }
    
    .card h3 {
        font-size: 14px !important;
    }
}

/* 表格排序样式 */
.sortable {
    cursor: pointer;
    position: relative;
    padding-right: 20px !important;
}

.sortable:hover {
    background-color: #f5f7fa;
}

.sortable::after {
    content: '';
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
}

.sort-asc::after {
    border-bottom: 4px solid #1890ff;
}

.sort-desc::after {
    border-top: 4px solid #1890ff;
}

/* 合计行样式 - 永远置底 */
.total-row {
    background-color: #e6f7ff !important;
    font-weight: bold !important;
    position: sticky !important;
    bottom: 0 !important;
    z-index: 10 !important;
}

.total-row td {
    border-top: 2px solid #1890ff !important;
}

/* 确保合计行不受排序影响 */
tr.total-row {
    display: table-row !important;
}
.notice {
    font-size: 12px;
    margin-top: 5px;
    margin-bottom: -10px !important;
}
}
