/* 全局变量 */
:root {
    --primary-color: #2563eb;
    --secondary-color: #f3f4f6;
    --accent-color: #3b82f6;
    --text-color: #1f2937;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --hover-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* 基础样式 */
body {
    background-color: #f9fafb;
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
}

/* 导航栏 */
.navbar {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    box-shadow: var(--card-shadow);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand i {
    font-size: 1.5rem;
}

.nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    transition: all 0.3s ease;
    margin: 0 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.nav-link i {
    font-size: 1rem;
}

/* 卡片样式 */
.card {
    border: none;
    border-radius: 1rem;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    background: white;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--hover-shadow);
    transform: translateY(-2px);
}

.card-header {
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
}

.card-title {
    color: var(--primary-color);
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-body {
    padding: 1.5rem;
}

/* 表单样式 */
.form-control, .form-select {
    border-radius: 0.75rem;
    border: 2px solid var(--border-color);
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.form-label {
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.form-check-input {
    width: 1.2em;
    height: 1.2em;
    margin-top: 0.25em;
    cursor: pointer;
    border: 2px solid var(--border-color);
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-label {
    cursor: pointer;
    user-select: none;
}

/* 按钮样式 */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    border: none;
    border-radius: 0.75rem;
    padding: 0.75rem 2rem;
    font-weight: 600;
    letter-spacing: 0.025em;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(37, 99, 235, 0.1);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.btn-primary:active {
    transform: translateY(0);
}

/* 表格样式 */
.table {
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    color: var(--text-color);
    background-color: var(--secondary-color);
    border-bottom: 2px solid var(--border-color);
}

.table td {
    vertical-align: middle;
    color: var(--text-color);
}

.table-hover tbody tr:hover {
    background-color: rgba(59, 130, 246, 0.05);
}

/* Markdown 样式 */
.markdown-body {
    color: var(--text-color);
}

.markdown-body pre {
    background-color: #f6f8fa;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.markdown-body code {
    color: #24292e;
    background-color: rgba(27, 31, 35, 0.05);
    border-radius: 0.25rem;
    padding: 0.2em 0.4em;
    font-size: 85%;
}

.markdown-body blockquote {
    color: #6a737d;
    border-left: 0.25em solid #dfe2e5;
    padding: 0 1em;
    margin: 0 0 1rem;
}

.markdown-body table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 1rem;
}

.markdown-body th,
.markdown-body td {
    padding: 0.5rem 1rem;
    border: 1px solid #dfe2e5;
}

.markdown-body th {
    background-color: #f6f8fa;
    font-weight: 600;
}

/* 加载动画 */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    backdrop-filter: blur(8px);
    display: none;
}

.loading-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .card-body {
        padding: 1rem;
    }
    
    .btn-primary {
        width: 100%;
    }
    
    .table-responsive {
        margin: 0 -1rem;
        width: calc(100% + 2rem);
    }
    
    .navbar-brand {
        font-size: 1.1rem;
    }
    
    .nav-link {
        margin: 0.25rem 0;
    }
}

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

.animate-slide-up {
    animation: slideUp 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* 工具类 */
.shadow-sm { box-shadow: var(--card-shadow) !important; }
.shadow-lg { box-shadow: var(--hover-shadow) !important; }
.rounded-lg { border-radius: 0.75rem !important; }
.text-primary { color: var(--primary-color) !important; }
.bg-primary { background-color: var(--primary-color) !important; }
.border-primary { border-color: var(--primary-color) !important; } 