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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #1a1a1a;
    color: #e0e0e0;
    min-height: 100vh;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 顶部导航栏 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background-color: #242424;
    border-bottom: 1px solid #3d3d3d;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo svg {
    display: block;
}

.header h1 {
    font-size: 18px;
    font-weight: 600;
    color: #e0e0e0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 主内容区 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 登录模块 */
.login-module {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background-color: #2d2d2d;
    border-radius: 8px;
    padding: 32px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

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

.login-card h2 {
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 24px;
    color: #e0e0e0;
}

.login-card .form-group {
    margin-bottom: 16px;
}

.login-card .form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #909090;
}

.login-card .form-group input {
    width: 100%;
    padding: 10px 14px;
    background-color: #242424;
    border: 1px solid #3d3d3d;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 14px;
    transition: border-color 0.2s;
}

.login-card .form-group input:focus {
    outline: none;
    border-color: #5470c6;
}

.login-card .form-group input::placeholder {
    color: #666;
}

.error-message {
    color: #ff6b6b;
    font-size: 13px;
    text-align: center;
    margin-top: 12px;
}

/* 查询模块 */
.query-module {
    flex: 1;
    display: flex;
    height: calc(100vh - 56px);
}

/* 侧边栏 */
.sidebar {
    width: 280px;
    background-color: #242424;
    border-right: 1px solid #3d3d3d;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.panel {
    background-color: #2d2d2d;
    border-radius: 8px;
    overflow: hidden;
}

.panel-header {
    padding: 12px 16px;
    background-color: #333;
    border-bottom: 1px solid #3d3d3d;
}

.panel-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: #e0e0e0;
}

.panel-body {
    padding: 16px;
}

.sidebar .form-group {
    margin-bottom: 14px;
}

.sidebar .form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: #909090;
}

.sidebar .form-group input,
.sidebar .form-group select {
    width: 100%;
    padding: 8px 12px;
    background-color: #242424;
    border: 1px solid #3d3d3d;
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 13px;
    transition: border-color 0.2s;
}

.sidebar .form-group input:focus,
.sidebar .form-group select:focus {
    outline: none;
    border-color: #5470c6;
}

.sidebar .form-group input::placeholder {
    color: #666;
}

.btn-group {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.2s;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background-color: #5470c6;
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background-color: #4a67b5;
}

.btn-secondary {
    background-color: #3d3d3d;
    color: #e0e0e0;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #4a4a4a;
}

.btn-sm {
    padding: 4px 12px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
}

.btn-text {
    display: inline-block;
}

.btn-spinner {
    font-size: 12px;
}

/* 字段选择 */
.field-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #e0e0e0;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    background-color: #242424;
    border: 1px solid #3d3d3d;
    border-radius: 3px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"]:checked {
    background-color: #5470c6;
    border-color: #5470c6;
}

/* 查询结果信息 */
.result-info {
    margin-bottom: 12px;
}

.result-info p {
    font-size: 13px;
    color: #909090;
    margin-bottom: 4px;
}

.result-info span {
    color: #e0e0e0;
    font-weight: 500;
}

.pagination {
    display: flex;
    gap: 8px;
}

/* 图表区域 */
.chart-area {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.chart-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
    gap: 20px;
    min-height: 400px;
}

.chart-item {
    background-color: #2d2d2d;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #3d3d3d;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.chart-title {
    font-size: 15px;
    font-weight: 600;
    color: #e0e0e0;
    margin-bottom: 12px;
    padding-left: 8px;
    border-left: 3px solid #5470c6;
}

.chart-wrapper {
    height: 280px;
}

/* 加载状态 */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: #909090;
}

.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 无数据状态 */
.no-data {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    color: #666;
}

.no-data svg {
    opacity: 0.5;
}

.no-data p {
    font-size: 14px;
}

/* Toast 提示 */
.toast {
    position: fixed;
    top: 70px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 14px;
    z-index: 1000;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.3s, transform 0.3s;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.success {
    background-color: #3ba272;
    color: #fff;
}

.toast.error {
    background-color: #ff6b6b;
    color: #fff;
}

.toast-icon {
    font-size: 16px;
}

/* 图表区域头部 */
.chart-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0 0 16px 0;
}

/* 显示模式切换 */
.display-mode-switch {
    display: flex;
    gap: 4px;
}

.display-mode-switch .btn {
    padding: 6px 16px;
    border-radius: 4px;
    font-size: 13px;
}

.display-mode-switch .btn.active {
    background-color: #5470c6;
    color: #fff;
    border-color: #5470c6;
}

/* 表格区域 */
.table-container {
    background-color: #2d2d2d;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #3d3d3d;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.table-wrapper {
    overflow-x: auto;
    max-height: 600px;
    overflow-y: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #3d3d3d;
}

.data-table th {
    background-color: #363636;
    color: #e0e0e0;
    font-weight: 600;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 1;
}

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

.data-table tbody tr:nth-child(even) {
    background-color: #2a2a2a;
}

.data-table tbody tr:nth-child(even):hover {
    background-color: #363636;
}

.data-table td {
    color: #b0b0b0;
    white-space: nowrap;
}

.data-table .status-charging {
    color: #3ba272;
    font-weight: 500;
}

.data-table .status-discharging {
    color: #ff6b6b;
    font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .query-module {
        flex-direction: column;
        height: auto;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #3d3d3d;
        overflow-y: visible;
        padding-bottom: 20px;
    }

    .chart-area {
        padding: 12px;
    }

    .header h1 {
        font-size: 16px;
    }

    .login-card {
        padding: 24px;
    }
}