/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: "Microsoft YaHei", Arial, sans-serif;
    background: #0f1c3c;
    color: #fff;
    overflow: hidden;
}

html, body {
    height: 100%;
    min-height: 100%;
    overflow: auto;
}

.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* 加载动画 */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loadbox {
    text-align: center;
    color: #fff;
}

.loadbox img {
    width: 50px;
    height: 50px;
    margin-bottom: 10px;
}

/* 头部样式 */
.head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 0.7rem;
    background: url('../images/head_bg.png') no-repeat center center;
    background-size: cover;
    padding: 0 0.3rem;
    z-index: 100;
}
.head h1 {
    font-size: 0.36rem;
    font-weight: bold;
    color: #00ffff;
    text-shadow: 0 0 20px #00ffff, 0 0 10px #003366;
    letter-spacing: 4px;
    margin: 0;
}
.weather {
    font-size: 0.2rem;
    color: #fff;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.user-controls {
    display: flex;
    align-items: center;
    gap: 0.15rem;
}

.user-controls span {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.16rem;
}

.user-btn, .logout-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 0.05rem 0.1rem;
    border-radius: 0.05rem;
    cursor: pointer;
    font-size: 0.14rem;
    transition: all 0.3s ease;
}

.user-btn:hover {
    background: rgba(0, 255, 255, 0.2);
    border-color: #00ffff;
}

.logout-btn {
    background: rgba(255, 107, 107, 0.2);
    border-color: rgba(255, 107, 107, 0.5);
    color: #ff6b6b;
}

.logout-btn:hover {
    background: rgba(255, 107, 107, 0.3);
}

.weather img {
    width: 0.3rem;
    height: 0.3rem;
    margin-right: 0.1rem;
}

/* 主要内容区域 */
.mainbox {
    position: relative;
    height: calc(100vh - 0.7rem); /* Fill remaining viewport height */
    min-height: 600px;
    overflow: visible;
    padding: 0.2rem;
    z-index: 10;
}

.mainbox ul {
    height: 100%; /* Fill the parent .mainbox height */
    min-height: 600px;
    display: flex;
    justify-content: space-between;
}

.mainbox li {
    width: 27.5%; /* 两侧略宽 */
    height: auto;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.mainbox li:nth-child(2) {
    width: 45%; /* 中间地图更窄 */
}
.mainbox li:not(:nth-child(2)) {
    width: 27.5%;
}

.mainbox li:nth-child(3) .boxall:nth-child(2) {
    flex: 1.5; /* Give this chart more vertical space */
}

/* 左侧第一列的模块均分 */
.mainbox li:first-child {
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* Ensure even distribution */
    gap: 0; /* Make sure there is no gap */
}

/* 右侧第三列的模块均分 */
.mainbox li:last-child .boxall {
    height: 33.33%; /* 右侧三个模块各占33.33%高度 */
}

/* 图表容器 */
.boxall {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.1rem;
    position: relative;
    overflow: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.boxall::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #00ffff, #0066ff);
}

.alltitle {
    height: 0.6rem;
    line-height: 0.6rem;
    text-align: center;
    font-size: 0.2rem;
    color: #fff;
    background: rgba(0, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.allnav {
    flex: 1 1 0%;
    height: 100%;
    min-height: 0;
    padding: 0.1rem;
    position: relative;
    display: flex;
    flex-direction: column;
}

#login-log-table, #patrol-log-table {
    flex: 1 1 0%;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

#login-log-table table, #patrol-log-table table {
    width: 100%;
    height: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    display: block;
}

#login-log-table thead, #patrol-log-table thead {
    display: block;
    width: 100%;
}

#login-log-table thead tr, #patrol-log-table thead tr {
    display: flex;
    width: 100%;
}

#login-log-table th, #patrol-log-table th {
    flex: 1;
    padding: 0.1rem 0.05rem;
    text-align: center;
    white-space: nowrap;
}

#login-log-table tbody, #patrol-log-table tbody {
    display: block;
    width: 100%;
    height: calc(100% - 0.45rem);
    overflow-y: auto;
}

#login-log-table tbody tr, #patrol-log-table tbody tr {
    display: flex;
    width: 100%;
}

#login-log-table td, #patrol-log-table td {
    flex: 1;
    padding: 0.1rem 0.05rem;
    text-align: center;
    white-space: nowrap;
}

#login-log-table tbody tr:nth-child(even), #patrol-log-table tbody tr:nth-child(even) {
    background: rgba(255,255,255,0.03);
}

#login-log-table tbody tr:hover, #patrol-log-table tbody tr:hover {
    background: rgba(0,255,255,0.12);
}

/* 滚动条美化 */
#login-log-table tbody::-webkit-scrollbar, #patrol-log-table tbody::-webkit-scrollbar {
    width: 6px;
}
#login-log-table tbody::-webkit-scrollbar-thumb, #patrol-log-table tbody::-webkit-scrollbar-thumb {
    background: rgba(0,255,255,0.2);
    border-radius: 3px;
}
#login-log-table tbody::-webkit-scrollbar-thumb:hover, #patrol-log-table tbody::-webkit-scrollbar-thumb:hover {
    background: rgba(0,255,255,0.4);
}

.bar {
    height: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.1rem;
    margin: 0; /* Remove all margins */
}

.barbox {
    height: 60%;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 0.3rem;
}

.barbox2 {
    height: 40%;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 0.3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.counter {
    font-size: 0.4rem;
    font-weight: bold;
    color: #00ffff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.barbox2 li {
    font-size: 0.16rem;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
}

.barbox2 span {
    font-size: 0.18rem;
}

/* 地图区域 */
.map {
    height: calc(100% - 1.5rem); /* Subtract exactly the height of .bar */
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.1rem;
    margin: 0; /* Ensure no margins */
}

.map1, .map2, .map3 {
    position: absolute;
    z-index: 1;
}

.map1 {
    top: 0.1rem;
    left: 0.1rem;
}

.map2 {
    top: 0.1rem;
    right: 0.1rem;
}

.map3 {
    bottom: 0.1rem;
    left: 50%;
    transform: translateX(-50%);
}

.map1 img, .map2 img, .map3 img {
    width: 0.8rem;
    height: 0.8rem;
}

.map4 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    min-height: 200px;
}

/* 三个小图表 */
.sy {
    height: 33.33%;
    position: relative;
}

#fb1, #fb2, #fb3 {
    height: 100%;
    width: 100%;
}

/* 背景 */
.back {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../images/bg.jpg') no-repeat center center;
    background-size: cover;
    z-index: -1;
}

.main-title {
    width: 100%;
    text-align: center;
    margin-top: 10px;
    margin-bottom: 5px;
}
.main-title h1 {
    font-size: 0.5rem;
    font-weight: bold;
    color: #00ffff;
    text-shadow: 0 0 20px #00ffff, 0 0 10px #003366;
    letter-spacing: 4px;
}

.map_controls button.active {
    background-color: #007aff;
    color: #fff;
    border-color: #007aff;
}
.map_controls {
    position: absolute;
    top: 5px;
    right: 20px;
    z-index: 999;
    background: rgba(0, 34, 64, 0.85);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,255,255,0.08);
    padding: 8px 18px 8px 12px;
    display: flex;
    align-items: center;
    gap: 18px;
    border: 1px solid #00ffff;
}
.map_controls label {
    color: #00ffff;
    font-size: 15px;
    vertical-align: middle;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    user-select: none;
    transition: color 0.2s;
}
.map_controls label:hover {
    color: #ffd700;
}
.map_controls input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #00ffff;
    border-radius: 4px;
    border: 1.5px solid #00ffff;
    margin-right: 3px;
    transition: box-shadow 0.2s;
    box-shadow: 0 0 4px #00ffff44;
}
.map_controls input[type="checkbox"]:hover {
    box-shadow: 0 0 8px #ffd70099;
    border-color: #ffd700;
}

.pie-container {
    display: flex;
    justify-content: center; /* Horizontally center the items */
    align-items: center;
    width: 100%;
    height: 100%;
    gap: 1rem; /* Add some space between pie charts */
}

.pie-item {
    display: flex; /* Add flex display to make child height % work */
    flex-direction: column;
    align-items: center;
    width: 80%; /* Make the single pie chart larger */
    height: 100%; /* Ensure the item itself has height */
    max-width: 400px; /* Optional: constrain max width on large screens */
}

.pie-item .chart {
    width: 100%;
    height: 80%; /* Adjust as needed */
}

.pie-item .title {
    color: #fff;
    font-size: 0.16rem;
    margin-top: -0.2rem; /* Adjust to position title correctly */
    text-align: center;
}


/* 响应式设计 */
@media (max-width: 1200px) {
    html {
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 12px;
    }
    
    .mainbox ul {
        flex-direction: column;
    }
    
    .mainbox li {
        width: 100%;
        height: auto;
        margin-bottom: 0.2rem;
    }

    .map {
        min-height: 260px;
        height: 260px;
        position: relative;
    }
    .map4 {
        min-height: 220px;
        height: 220px;
        position: relative;
    }
} 