/* 主样式文件 */
html {
    height: 100%;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f8f9fa;
    font-size: 14px;
    padding-top: 30px; /* 减小为固定头部预留的空间 */
    min-height: 100%;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
}

.card {
    margin-bottom: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.card-header {
    font-size: 16px;
    font-weight: bold;
}

.card-body {
    font-size: 14px;
}

h1 {
    font-size: 24px;
    margin-bottom: 20px;
}

.form-control {
    font-size: 14px;
    height: 36px;
}

.btn {
    font-size: 14px;
    padding: 6px 12px;
}

.alert {
    font-size: 13px;
    padding: 10px;
    margin-bottom: 15px;
}

.table {
    font-size: 13px;
}

.table th {
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
}

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

.table td {
    font-size: 13px;
}

.display-4 {
    font-size: 2rem;
    font-weight: 500;
}

.text-center {
    text-align: center;
}

.pagination {
    margin-top: 15px;
    justify-content: center;
}

.pagination .page-item .page-link {
    font-size: 13px;
    padding: 6px 12px;
}

.sort-indicator {
    margin-left: 5px;
    font-size: 10px;
    color: #666;
}

/* 固定总量信息样式 */
.fixed-total {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 8px 0;
    z-index: 1000;
    display: none;
}

.fixed-total-content {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.fixed-total-item {
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.fixed-total-icon {
    margin-bottom: 2px;
}

.fixed-total-label {
    font-size: 11px;
    color: #666;
    margin-bottom: 2px;
}

.fixed-total-value {
    font-size: 14px;
    font-weight: bold;
}

.fixed-total-change {
    font-size: 12px;
    margin-top: 2px;
}

.fixed-total-change.positive {
    color: #28a745;
}

.fixed-total-change.negative {
    color: #dc3545;
}

/* 统计卡片样式 */
.stat-card {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    color: #333;
    background: white;
    border: 1px solid #dee2e6;
}

.stat-label {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    text-align: left;
    padding-left: 10px;
}

.stat-content {
    display: flex;
    align-items: center;
}

.stat-icon {
    flex: 0 0 80px;
    text-align: center;
    border: none;
    padding: 10px;
    border-radius: 4px;
    background: white;
}

.stat-icon img {
    width: 50px;
    height: 50px;
    display: block;
    margin: 0 auto;
}

.stat-value-container {
    flex: 1;
    text-align: right;
    padding-left: 15px;
}

.stat-value {
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
    word-wrap: break-word;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 576px) {
    .stat-value {
        font-size: 16px;
    }
}

@media (min-width: 992px) {
    .stat-value {
        font-size: 24px;
    }
}

.stat-change {
    font-size: 16px;
    margin-top: 5px;
}

@media (max-width: 576px) {
    .stat-change {
        font-size: 14px;
    }
}

@media (min-width: 992px) {
    .stat-change {
        font-size: 18px;
    }
}

.stat-card.bg-primary,
.stat-card.bg-success,
.stat-card.bg-warning,
.stat-card.bg-info {
    border-left: none;
}

.stat-change.positive {
    color: #28a745;
}

.stat-change.negative {
    color: #dc3545;
}

/* 图表容器样式 */
.chart-container {
    position: relative;
    width: 100%;
    margin: 0 auto;
}

/* 图表容器 */
.chart-container {
    position: relative;
    width: 100%;
    height: 400px;
    margin: 0 auto;
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

/* 折叠按钮图标样式 */
.collapse-btn {
    position: relative;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
}

.collapse-icon {
    position: relative;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.collapse-icon .line {
    position: absolute;
    background-color: #333;
    transition: all 0.3s ease;
}

.collapse-icon .line.horizontal {
    width: 12px;
    height: 2px;
    transform: rotate(0deg);
}

.collapse-icon .line.vertical {
    width: 2px;
    height: 12px;
    transform: rotate(0deg);
}

.collapse-icon .line.diagonal {
    width: 12px;
    height: 2px;
    transform: rotate(45deg);
    top: 7px;
    left: 2px;
}

/* 折叠状态下的图标 */
.collapse-btn[aria-expanded="false"] .collapse-icon {
    position: relative;
}

.collapse-btn[aria-expanded="false"] .collapse-icon .line.horizontal {
    opacity: 0;
    transform: rotate(0deg) scale(0);
}

.collapse-btn[aria-expanded="false"] .collapse-icon .line.vertical {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.collapse-btn[aria-expanded="false"] .collapse-icon .line.diagonal {
    opacity: 1;
    transform: rotate(45deg) scale(1);
}

/* 展开状态下的图标 */
.collapse-btn[aria-expanded="true"] .collapse-icon .line.horizontal {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.collapse-btn[aria-expanded="true"] .collapse-icon .line.vertical {
    opacity: 0;
    transform: rotate(0deg) scale(0);
}

.collapse-btn[aria-expanded="true"] .collapse-icon .line.diagonal {
    opacity: 0;
    transform: rotate(45deg) scale(0);
}

/* 动画效果 */
.collapse-btn[aria-expanded="true"] .collapse-icon .line {
    transition: all 0.3s ease;
}

.collapse-btn[aria-expanded="false"] .collapse-icon .line {
    transition: all 0.3s ease;
}

/* 模拟器样式 */
.simulator-btn {
    transition: all 0.3s ease;
    border-radius: 6px;
}

.simulator-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* 模拟器弹出框动画 */
#simulator-iframe-container {
    transition: all 0.3s ease;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
}

#simulator-iframe-container.show {
    opacity: 1;
    max-height: 600px;
}

/* 说明文字样式 */
.simulator-content p {
    color: #6c757d;
    font-size: 13px;
}

/* 弹窗遮罩层 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 弹窗内容 */
.modal-content {
    background-color: white;
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 弹窗头部 */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e9ecef;
    font-weight: bold;
    font-size: 16px;
}

/* 弹窗关闭按钮 */
.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
    line-height: 1;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #333;
}

/* 弹窗主体 */
.modal-body {
    padding: 20px;
}

/* 弹窗表单样式 */
.modal-body .form-group {
    margin-bottom: 15px;
}

.modal-body .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 13px;
}

.modal-body .form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
}

.modal-body .form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.modal-body .row {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
}

.modal-body .row .col-6 {
    flex: 1;
}

.modal-body .row .col-6 label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 13px;
}

.modal-body .row .col-6 .form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
}
