/**
 * 主样式文件 - main.css
 * 作用：为整个生产数据管理平台提供统一的样式系统
 * 包含：
 * 1. 全局样式重置
 * 2. 4角线框系统（所有容器块）
 * 3. 组件类型样式（图表、表格、地图）
 * 4. 布局容器样式
 * 5. 响应式设计
 * 6. 滚动条样式
 */

/* ==================== 全局样式重置 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: Arial, sans-serif;
    /*background-color: #011a3a;*/
    background-color: rgb(1,33,70);
    color: #fff;
}

/* ==================== 显示滚动条 ==================== */
.hide-scrollbar {
    /* 暂时取消滚动控制，显示滚动条 */
    -ms-overflow-style: auto;
    scrollbar-width: auto;
}
.hide-scrollbar::-webkit-scrollbar {
    display: block;
    width: 0; /*去除滚动条占位*/
}

/* ==================== 容器组件 - 4角线框系统 ==================== */
.component-box {
    position: relative;
    border: 1px solid #2C58A6;
    box-shadow: 0 0 10px rgba(44, 88, 166, 0.5);
    background: rgba(7, 41, 81, 0.5);
    /*overflow: hidden;*/
}

/* 4角线框 - 使用伪元素精确定位 */
.component-box::before,
.component-box::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-color: #4788fb;
    border-style: solid;
    z-index: 10;
}

.component-box::before {
    top: -1px;
    left: -1px;
    border-width: 2px 0 0 2px;
}

.component-box::after {
    top: -1px;
    right: -1px;
    border-width: 2px 2px 0 0;
}

/* 使用额外的元素作为底部的角线 */
.component-box .corner-bottom-left,
.component-box .corner-bottom-right {
    position: absolute;
    width: 20px;
    height: 20px;
    border-color: #4788fb;
    border-style: solid;
    z-index: 10;
}

.component-box .corner-bottom-left {
    bottom: -1px;
    left: -1px;
    border-width: 0 0 2px 2px;
}

.component-box .corner-bottom-right {
    bottom: -1px;
    right: -1px;
    border-width: 0 2px 2px 0;
}

/* ==================== 标题样式 ==================== */
.box-title {
    position: absolute;
    top: -17px;
    left: 50%;
    transform: translateX(-50%);
    height: 34px;
    line-height: 32px;
    background: linear-gradient(135deg, #2C58A6 0%, #1a4a96 100%);
    border-radius: 17px 17px 17px 17px;
    padding: 0 20px 0 40px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    z-index: 20;
    box-shadow: 0 2px 8px rgba(44, 88, 166, 0.4);
}

.box-title img {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
}

/* ==================== 内容区域 ==================== */
.box-content {
    width: 100%;
    height: 100%;
    padding-top: 22px;
    overflow: hidden;
}

/* ==================== 组件类型 - 图表 ==================== */
.component-chart {
    width: 100%;
    height: 100%;
}

.component-chart canvas {
    width: 100% !important;
    height: 100% !important;
}

/* ==================== 组件类型 - 表格 ==================== */
.component-table {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.component-table table {
    width: 100%;
    border-collapse: collapse;
}

.component-table thead {
    background: linear-gradient(180deg, #1a4a96 0%, #0d2d56 100%);
}

.component-table th {
    padding: 10px 8px;
    font-size: 12px;
    font-weight: 600;
    color: #61d2f7;
    text-align: center;
    border-bottom: 1px solid #2C58A6;
}

.component-table td {
    padding: 8px;
    font-size: 11px;
    color: #fff;
    text-align: center;
    border-bottom: 1px solid rgba(44, 88, 166, 0.3);
}

.component-table tbody tr:nth-child(odd) {
    background: rgba(7, 41, 81, 0.8);
}

.component-table tbody tr:hover {
    background: rgba(71, 136, 251, 0.2);
}

/* ==================== 组件类型 - 滚动表格 ==================== */
.component-table-scroll {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

.component-table-scroll table {
    width: 100%;
}

.component-table-scroll thead {
    position: sticky;
    top: 0;
    z-index: 5;
    background: linear-gradient(180deg, #1a4a96 0%, #0d2d56 100%);
}

.component-table-scroll th {
    padding: 10px 8px;
    font-size: 12px;
    font-weight: 600;
    color: #61d2f7;
    text-align: center;
    border-bottom: 1px solid #2C58A6;
}

.component-table-scroll td {
    padding: 8px;
    font-size: 11px;
    color: #fff;
    text-align: center;
    border-bottom: 1px solid rgba(44, 88, 166, 0.3);
}

.component-table-scroll tbody tr:nth-child(odd) {
    background: rgba(7, 41, 81, 0.8);
}

.component-table-scroll tbody tr:hover {
    background: rgba(71, 136, 251, 0.2);
}

/* ==================== 组件类型 - 地图 ==================== */
.component-map {
    width: 100%;
    height: 100%;
}

.component-map canvas {
    width: 100% !important;
    height: 100% !important;
}

/* ==================== 布局容器 ==================== */
.layout-container {
    width: 100%;
    height: calc(100% - 100px);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.layout-row {
    width: 100%;
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.layout-row:last-child {
    margin-bottom: 0;
}

/* 4列布局 */
.layout-col-left,
.layout-col-right,
.layout-col-bottom {
    width: 25%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.layout-col-center {
    width: 50%;
}

/* 底部4列布局 */
.layout-bottom {
    display: flex;
    gap: 20px;
    width: 100%;
}

.layout-bottom > div {
    flex: 1;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 1400px) {
    .layout-row {
        flex-wrap: wrap;
    }
    
    .layout-col-left,
    .layout-col-center,
    .layout-col-right {
        width: 100%;
        margin-bottom: 20px;
    }
    
    .layout-col-left > div,
    .layout-col-right > div {
        margin-bottom: 20px;
    }
}

@media (max-width: 768px) {
    .box-title {
        font-size: 12px;
        padding: 0 12px 0 30px;
    }
    
    .box-title img {
        width: 16px;
        height: 16px;
        left: 8px;
    }
    
    .component-table th,
    .component-table td,
    .component-table-scroll th,
    .component-table-scroll td {
        padding: 6px 4px;
        font-size: 10px;
    }
}