/* static/css/style.css */

:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --info-color: #3498db;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --border-color: #dee2e6;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft JhengHei', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 卡片样式增强 */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 10px var(--shadow-color);
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.card-header {
    background-color: white;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    border-radius: 10px 10px 0 0 !important;
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

/* 按钮样式增强 */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
    padding: 0.5rem 1.5rem;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn:active {
    transform: translateY(0);
}

.btn-lg {
    padding: 0.75rem 2rem;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.875rem;
}

/* 表单样式增强 */
.form-control, .form-select {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    transition: all 0.2s ease;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #495057;
}

/* 表格样式增强 */
.table {
    margin-bottom: 0;
}

.table th {
    border-top: none;
    font-weight: 600;
    color: var(--dark-color);
    text-transform: uppercase;
    font-size: 0.875rem;
    background-color: #f8f9fa;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

.table > :not(:last-child) > :last-child > * {
    border-bottom-color: var(--border-color);
}

/* 徽章样式增强 */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
    border-radius: 6px;
}

/* 导航栏样式增强 */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 0.75rem 1rem;
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 4px;
}

.nav-link:hover, .nav-link.active {
    background-color: rgba(255, 255, 255, 0.1);
}

/* 下拉菜单样式增强 */
.dropdown-menu {
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-top: 0.5rem;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    font-weight: 500;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

/* 模态框样式增强 */
.modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}

/* 警告框样式增强 */
.alert {
    border: none;
    border-radius: 8px;
    padding: 1rem 1.25rem;
}

.alert-dismissible .btn-close {
    padding: 1rem 1.25rem;
}

/* 进度条样式增强 */
.progress {
    height: 8px;
    border-radius: 4px;
    background-color: #e9ecef;
}

.progress-bar {
    border-radius: 4px;
    transition: width 0.6s ease;
}

/* 列表组样式增强 */
.list-group-item {
    border: 1px solid var(--border-color);
    padding: 0.75rem 1.25rem;
}

.list-group-item:first-child {
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.list-group-item:last-child {
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* 分页样式增强 */
.pagination .page-link {
    border: none;
    margin: 0 2px;
    border-radius: 6px;
    color: #495057;
}

.pagination .page-link:hover {
    background-color: #e9ecef;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* 控制台日志样式 */
.console-output {
    background-color: #1e1e1e;
    color: #d4d4d4;
    padding: 1rem;
    border-radius: 8px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    line-height: 1.5;
}

.log-entry {
    margin-bottom: 2px;
    padding: 2px 0;
    border-left: 3px solid transparent;
    padding-left: 10px;
}

.log-entry.success {
    border-left-color: #28a745;
    color: #28a745;
}

.log-entry.error {
    border-left-color: #dc3545;
    color: #dc3545;
}

.log-entry.warning {
    border-left-color: #ffc107;
    color: #ffc107;
}

.log-entry.info {
    border-left-color: #17a2b8;
    color: #17a2b8;
}

/* 状态指示器 */
.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
}

.status-indicator.active {
    background-color: #28a745;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.3);
}

.status-indicator.inactive {
    background-color: #dc3545;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.3);
}

.status-indicator.warning {
    background-color: #ffc107;
    box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.3);
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.pulse {
    animation: pulse 2s infinite;
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 工具提示增强 */
.tooltip {
    font-size: 0.875rem;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .card-body {
        padding: 1rem;
    }

    .btn {
        padding: 0.375rem 1rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .navbar-nav {
        margin-top: 0.5rem;
    }
}

@media (max-width: 576px) {
    .container-fluid {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .card {
        margin-bottom: 1rem;
    }

    .table-responsive {
        font-size: 0.875rem;
    }
}

/* 自定义实用类 */
.text-ellipsis {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cursor-pointer {
    cursor: pointer;
}

.border-dashed {
    border-style: dashed !important;
}

.shadow-sm {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

.shadow-md {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
}

.shadow-lg {
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1) !important;
}

.bg-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* 自定义滚动容器 */
.scroll-container {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}

.scroll-container::-webkit-scrollbar {
    width: 6px;
}

/* 分隔线 */
.divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 1rem 0;
    border: none;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* 统计卡片 */
.stats-card {
    text-align: center;
    padding: 1.5rem;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.stats-card h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stats-card p {
    opacity: 0.9;
    margin-bottom: 0;
}

/* 代码块样式 */
.code-block {
    background-color: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.875rem;
    overflow-x: auto;
}

/* 网格布局工具 */
.grid {
    display: grid;
    gap: 1rem;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* 自定义复选框和单选框 */
.custom-checkbox .form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.custom-radio .form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* 切换开关 */
.form-switch .form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* 面包屑导航 */
.breadcrumb {
    background-color: transparent;
    padding: 0.75rem 0;
    margin-bottom: 1rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: #6c757d;
}

/* 页脚样式 */
.footer {
    margin-top: 3rem;
    padding: 1.5rem 0;
    background-color: #f8f9fa;
    border-top: 1px solid var(--border-color);
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    display: inline-block;
    margin-right: 1rem;
}

.footer-links a {
    color: #6c757d;
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--primary-color);
}


/* 添加自动处理状态样式 */
.auto-processing {
    animation: pulse 1.5s infinite;
    border-color: #0d6efd !important;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

.processing-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: #0d6efd;
    border-radius: 50%;
    margin-right: 8px;
    animation: processing 1s infinite;
}

@keyframes processing {
    0% { transform: scale(0.8); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.8); opacity: 0.5; }
}


/* 公告样式 */
.announcement-list {
    max-height: 300px;
    overflow-y: auto;
}

.announcement-item {
    border-left: 3px solid #007bff;
    padding: 10px 15px;
    margin-bottom: 10px;
    background-color: #f8f9fa;
    border-radius: 0 4px 4px 0;
}

.announcement-item.pinned {
    border-left-color: #ffc107;
    background-color: #fff8e1;
}

.announcement-item.expired {
    border-left-color: #6c757d;
    opacity: 0.7;
}

.announcement-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.announcement-title {
    font-weight: bold;
    color: #333;
    margin: 0;
}

.announcement-meta {
    font-size: 0.85rem;
    color: #6c757d;
}

.announcement-content {
    color: #555;
    margin-bottom: 5px;
    line-height: 1.5;
}

.announcement-badges {
    margin-top: 5px;
}

.announcement-placeholder {
    padding: 20px;
}

/* 登录页面公告 */
.announcement-section {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
}