/* 全局字体渲染优化 */
:root {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    font-synthesis: none;
}

/* 响应式布局 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* 全局字体设置 */
html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    font-synthesis: none;
}

body {
    font-family: -apple-system, 'Microsoft YaHei', BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    background-color: #f5f5f5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
    letter-spacing: -0.01em;
}

/* 确保所有文本元素都使用优化的字体渲染 */
h1,
h2,
h3,
h4,
h5,
h6,
p,
span,
a,
li,
td,
th,
input,
button,
select,
textarea {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* 高DPI屏幕优化 */
@media screen and (min-resolution: 192dpi),
screen and (-webkit-min-device-pixel-ratio: 2),
screen and (min--moz-device-pixel-ratio: 2),
screen and (-o-min-device-pixel-ratio: 2/1),
screen and (min-device-pixel-ratio: 2) {

    html,
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        text-rendering: optimizeLegibility;
    }

    /* 确保所有文本元素在高DPI屏幕上都清晰 */
    h1,
    h2,
    h3,
    h4,
    h5,
    h6,
    p,
    span,
    a,
    li,
    td,
    th,
    input,
    button,
    select,
    textarea {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        text-rendering: optimizeLegibility;
    }

    /* 优化小字体的显示 */
    small,
    .small {
        -webkit-font-smoothing: subpixel-antialiased;
        -moz-osx-font-smoothing: auto;
    }

    /* 优化粗体文字 */
    strong,
    b,
    .bold {
        font-weight: 600;
        letter-spacing: -0.02em;
    }
}

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

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

label {
    display: block;
    margin-bottom: 5px;
}

input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

button {
    width: 100%;
    padding: 10px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

button:hover {
    background: #0056b3;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .login-container {
        margin: 20px;
        padding: 15px;
    }
}


/* 移动端适配 */
@media (max-width: 368px) {
    .login-container {
        margin: 20px;
        padding: 15px;
    }
}

@media screen and (max-width: 1280px) {
    html {
        font-size: 12px !important;
        text-size-adjust: 100%;
        -webkit-text-size-adjust: 100%;
        font-feature-settings: "kern" 1;
    }
}

@media screen and (min-width: 1281px) and (max-width: 1365px) {
    html {
        font-size: 14px !important;
        text-size-adjust: 100%;
        -webkit-text-size-adjust: 100%;
        font-feature-settings: "kern" 1;
    }

    .dataWatsh .service-bottom-box .title {
        padding-top: 1% !important;
    }
}

@media screen and (min-width: 1366px) and (max-width: 1440px) {
    html {
        font-size: 14px !important;
        text-size-adjust: 100%;
        -webkit-text-size-adjust: 100%;
        font-feature-settings: "kern" 1;
    }
}

@media screen and (min-width: 1441px) and (max-width: 1500px) {
    html {
        font-size: 14px;
        /* 移除 transform: scale() */
        width: 100%;
        height: 100%;
    }
}

@media screen and (min-width: 1501px) and (max-width: 1536px) {
    html {
        font-size: 14px;
        /* 移除 transform: scale() */
        width: 100%;
        height: 100%;
    }
}

@media screen and (min-width: 1537px) and (max-width: 1919px) {
    html {
        font-size: 14px;
        /* 移除 transform: scale() */
        width: 100%;
        height: 100%;
    }
}

@media screen and (min-width: 1920px) and (max-width: 2130px) {
    html {
        font-size: 16px !important;
    }
}

@media screen and (min-width: 1590px) and (max-width: 1610px) and (min-height: 890px) and (max-height: 910px) {
    html {
        font-size: 14px;
        /* 移除 transform: scale() */
    }

    /* 使用更好的缩放方法处理地图 */
    .map {
        width: 800px !important;
        height: 800px !important;
        transform: none;
        /* 移除 transform */
    }
}

/* 添加字体清晰度优化 */
button,
input,
select,
textarea {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "kern" 1;
    letter-spacing: -0.01em;
}

/* 优化文本选择效果 */
::selection {
    background: rgba(0, 123, 255, 0.2);
    text-shadow: none;
}

/* 优化链接文字 */
a {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "kern" 1;
}

/* 优化表格文字 */
.table {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "kern" 1;
    letter-spacing: -0.01em;
}

/* 确保SVG和图标清晰 */
svg,
img,
.icon {
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

/* 优化文字阴影 */
.text-shadow {
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

/* 添加导出部分样式 */
.export-section {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 0.25rem;
    margin-bottom: 1.5rem;
}

.export-section h4 {
    color: #495057;
    margin-bottom: 1rem;
}

/* 响应式调整 */
@media (max-width: 768px) {

    .export-section .col-md-2,
    .export-section .col-md-3 {
        margin-bottom: 1rem;
    }

    .export-section button {
        width: 100%;
    }
}

/* 表格样式优化 */
.table-responsive {
    margin-top: 1rem;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 0.25rem;
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

/* 通用按钮样式 - 确保文字居中 */
button,
.btn {
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 按钮样式优化 */
.btn-success {
    background-color: #28a745;
    border-color: #28a745;
}

.btn-success:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

/* 主区域布局优化 */
.main-content {
    transition: margin-left 0.3s ease, width 0.3s ease;
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 20px !important;
    background: transparent !important;
    z-index: 1000 !important;
    width: 100% !important;
    margin-left: 0 !important;
}

.main-content.shifted {
    margin-left: 220px !important;
    width: calc(100% - 220px) !important;
}

/* 图表容器优化 */
.chart-container {
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 auto !important;
    transition: none !important;
    /* 移除图表容器的过渡效果 */
}

/* 图表网格布局 */
.charts-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)) !important;
    gap: 20px !important;
    padding: 20px !important;
    margin: 0 auto !important;
    width: 100% !important;
    max-width: 1800px !important;
}

/* 确保图表响应式但不变形 */
.chart-wrapper {
    position: relative !important;
    width: 100% !important;
    padding-top: 60% !important;
    /* 保持固定的宽高比 */
    background: rgba(255, 255, 255, 0.05) !important;
    border-radius: 8px !important;
    overflow: hidden !important;
}

.chart-wrapper canvas,
.chart-wrapper .echarts {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    transition: none !important;
    /* 移除图表元素的过渡效果 */
}

/* 响应式布局优化 */
@media screen and (max-width: 1280px) {
    .charts-grid {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 350px), 1fr)) !important;
        gap: 15px !important;
    }
}

@media screen and (max-width: 768px) {
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }

    .charts-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .chart-wrapper {
        padding-top: 75% !important;
        /* 在小屏幕上调整宽高比 */
    }
}

/* 确保图表容器在过渡期间保持稳定 */
.chart-container,
.chart-wrapper,
.echarts-container {
    backface-visibility: hidden !important;
    transform: translateZ(0) !important;
    -webkit-font-smoothing: subpixel-antialiased !important;
    will-change: transform !important;
}