/* 自定义样式 */

/* 全局样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

/* 导航栏样式 */
.navbar-brand {
    font-weight: 600;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: #fff !important;
}

.navbar-nav .nav-link.active {
    color: #fff !important;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 0.375rem;
}

/* 卡片样式 */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: box-shadow 0.15s ease-in-out;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: #fff;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
}

/* 统计卡片样式 */
.card.bg-primary,
.card.bg-success,
.card.bg-warning,
.card.bg-info,
.card.bg-danger {
    border: none;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

.card.bg-primary .card-body,
.card.bg-success .card-body,
.card.bg-warning .card-body,
.card.bg-info .card-body,
.card.bg-danger .card-body {
    padding: 1.5rem;
}

.card.bg-primary .card-title,
.card.bg-success .card-title,
.card.bg-warning .card-title,
.card.bg-info .card-title,
.card.bg-danger .card-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* 按钮样式 */
.btn {
    font-weight: 500;
    border-radius: 0.375rem;
    transition: all 0.15s ease-in-out;
}

.btn-group-sm > .btn,
.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* 表格样式 */
.table {
    background-color: #fff;
}

.table th {
    border-top: none;
    font-weight: 600;
    color: #495057;
    background-color: #f8f9fa;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.025);
}

/* 徽章样式 */
.badge {
    font-weight: 500;
    font-size: 0.75em;
}

/* 表单样式 */
.form-control,
.form-select {
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus,
.form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* 全局加载遮罩 */
.global-loader {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(33, 37, 41, 0.35);
    backdrop-filter: blur(2px);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.global-loader.show {
    opacity: 1;
    pointer-events: all;
}

.global-loader__card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1.25rem 1.5rem;
    border-radius: 0.75rem;
    background: #ffffff;
    box-shadow: 0 1.5rem 3rem -1rem rgba(13, 110, 253, 0.25);
    min-width: 220px;
}

.global-loader__spinner {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    border: 0.25rem solid #e9ecef;
    border-top-color: #0d6efd;
    animation: global-loader-spin 0.7s linear infinite;
}

.global-loader__message {
    font-weight: 600;
    color: #212529;
    letter-spacing: 0.01em;
}

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

.form-label {
    font-weight: 500;
    color: #495057;
}

.form-text {
    color: #6c757d;
    font-size: 0.875em;
}

/* 模态框样式 */
.modal-content {
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.modal-header {
    border-bottom: 1px solid #dee2e6;
    background-color: #f8f9fa;
}

.modal-title {
    font-weight: 600;
}

/* 提示框样式 */
.alert {
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
}

.alert-success {
    background-color: #d1e7dd;
    color: #0f5132;
}

.alert-danger {
    background-color: #f8d7da;
    color: #842029;
}

.alert-warning {
    background-color: #fff3cd;
    color: #664d03;
}

.alert-info {
    background-color: #d1ecf1;
    color: #055160;
}

/* 加载动画 */
.spinner-border {
    width: 2rem;
    height: 2rem;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* 状态指示器 */
.status-indicator {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    margin-right: 0.5rem;
}

.status-indicator.running {
    background-color: #28a745;
    animation: pulse 2s infinite;
}

.status-indicator.stopped {
    background-color: #6c757d;
}

.status-indicator.error {
    background-color: #dc3545;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

/* 代码样式 */
code {
    background-color: #f8f9fa;
    color: #e83e8c;
    padding: 0.125rem 0.25rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
}

/* 页脚样式 */
footer {
    margin-top: auto;
    border-top: 1px solid #dee2e6;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .card.bg-primary .card-title,
    .card.bg-success .card-title,
    .card.bg-warning .card-title,
    .card.bg-info .card-title,
    .card.bg-danger .card-title {
        font-size: 1.5rem;
    }
    
    .btn-group-sm > .btn,
    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
}

/* 自定义工具类 */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.border-left-primary {
    border-left: 0.25rem solid #007bff !important;
}

.border-left-success {
    border-left: 0.25rem solid #28a745 !important;
}

.border-left-warning {
    border-left: 0.25rem solid #ffc107 !important;
}

.border-left-danger {
    border-left: 0.25rem solid #dc3545 !important;
}

/* 账户卡片特殊样式 */
.account-card {
    transition: transform 0.2s ease-in-out;
}

.account-card:hover {
    transform: translateY(-2px);
}

.account-status-running {
    border-left: 4px solid #28a745;
}

.account-status-stopped {
    border-left: 4px solid #6c757d;
}

.account-status-error {
    border-left: 4px solid #dc3545;
}

/* 统计图表容器 */
.chart-container {
    position: relative;
    height: 300px;
    margin: 1rem 0;
}

/* 数据表格增强 */
.data-table {
    font-size: 0.9rem;
}

.data-table th {
    white-space: nowrap;
}

.data-table td {
    vertical-align: middle;
}

/* 表单增强 */
.form-section {
    background-color: #fff;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.form-section h6 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* 服务状态样式 */
.service-status {
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
}

.service-status.running {
    background-color: #d1e7dd;
    color: #0f5132;
}

.service-status.stopped {
    background-color: #f8d7da;
    color: #842029;
}

.service-status i {
    margin-right: 0.5rem;
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
