/* 自定义样式 */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
}

body {
    background-color: var(--light-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* 导航栏样式 */
.navbar-brand {
    font-weight: bold;
    font-size: 1.25rem;
}

.navbar-brand i {
    margin-right: 0.5rem;
}

/* 卡片样式 */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: var(--light-color);
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    font-weight: 600;
}

/* 搜索框样式 */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* 搜索结果样式 */
.torrent-item {
    border: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background-color: white;
    transition: all 0.2s ease-in-out;
}

.torrent-item:hover {
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.torrent-title {
    font-weight: 600;
    color: var(--dark-color);
    text-decoration: none;
    display: block;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.torrent-title:hover {
    color: var(--primary-color);
}

/* 搜索关键词高亮样式 */
.search-highlight {
    background-color: #fff3cd;
    color: #856404;
    padding: 0.1em 0.2em;
    border-radius: 0.2em;
    font-weight: 600;
}

.torrent-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--secondary-color);
}

.torrent-meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.torrent-meta-item i {
    font-size: 0.875rem;
}

.torrent-categories {
    margin-top: 0.5rem;
}

.category-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    margin-right: 0.25rem;
}

/* 网格视图样式 */
.torrent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.torrent-grid .torrent-item {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.torrent-grid .torrent-item .card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.torrent-grid .torrent-item .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 统计卡片样式 */
.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1rem;
}

.stat-card.primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

.stat-card.success {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
}

.stat-card.warning {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
}

.stat-card.danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.stat-card.info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* 健康状态样式 */
.health-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.health-status.healthy {
    color: var(--success-color);
}

.health-status.unhealthy {
    color: var(--danger-color);
}

.health-status.unknown {
    color: var(--warning-color);
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.status-indicator.healthy {
    background-color: var(--success-color);
}

.status-indicator.unhealthy {
    background-color: var(--danger-color);
}

.status-indicator.unknown {
    background-color: var(--warning-color);
}

/* 分页样式 */
.pagination .page-link {
    color: var(--primary-color);
    border-color: #dee2e6;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.pagination .page-link:hover {
    color: var(--primary-color);
    background-color: var(--light-color);
    border-color: #dee2e6;
}

/* 模态框样式 */
.modal-header {
    background-color: var(--light-color);
    border-bottom: 1px solid #dee2e6;
}

.modal-title {
    font-weight: 600;
}

/* 文件列表样式 */
.torrent-files .file-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.torrent-files .file-item:last-child {
    border-bottom: none;
}

.torrent-files .file-name {
    min-width: 0; /* 允许文件名区域缩小 */
    margin-right: 1rem;
}

.torrent-files .file-name-text {
    word-break: break-all; /* 长文件名换行 */
    line-height: 1.4;
}

.torrent-files .file-size .badge {
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

/* 响应式文件列表 */
@media (max-width: 768px) {
    .torrent-files .file-item {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.25rem;
    }
    
    .torrent-files .file-name {
        margin-right: 0;
        width: 100%;
    }
    
    .torrent-files .file-size {
        align-self: flex-end;
    }
}

/* 标签样式 */
.torrent-tags {
    margin-top: 0.5rem;
}

.tag {
    font-size: 0.75rem;
    padding: 0.125rem 0.375rem;
    margin-right: 0.25rem;
    background-color: var(--light-color);
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    color: var(--secondary-color);
}

/* 加载动画样式 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .torrent-meta {
        font-size: 0.75rem;
        gap: 0.5rem;
    }
    
    .torrent-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .modal-dialog {
        margin: 0.5rem;
    }
}

/* 工具提示样式 */
.tooltip {
    font-size: 0.875rem;
}

/* 复制成功提示 */
.copy-success {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

/* 高级搜索区域样式 */
#advancedSearch {
    border-top: 1px solid #dee2e6;
    padding-top: 1rem;
    margin-top: 1rem;
}

/* 按钮悬停效果 */
.btn:hover {
    transform: translateY(-1px);
    transition: all 0.2s ease-in-out;
}

.btn:active {
    transform: translateY(0);
}

/* 搜索结果计数器 */
.result-counter {
    background-color: var(--primary-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--secondary-color);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h5 {
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.875rem;
    margin-bottom: 1rem;
}
/* ���������ʽ */
.recent-torrent-item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0.75rem 0;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.recent-torrent-item:last-child {
    border-bottom: none;
}

.recent-torrent-item:hover {
    background-color: rgba(0, 123, 255, 0.05);
    padding-left: 0.5rem;
}

.recent-torrent-title {
    font-weight: 500;
    color: var(--dark-color);
    margin-bottom: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.recent-torrent-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.75rem;
}

.recent-torrent-meta .badge {
    font-weight: 500;
}

#recentTorrents {
    /* max-height: 400px; */
    /* overflow-y: auto; */
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

#refreshRecent:active i {
    animation: rotate 0.5s ease-in-out;
}

/* Footer 样式 */
footer {
    background-color: #2d3436 !important;
    border-top: 2px solid #636e72 !important;
    margin-top: 3rem;
}

footer h5 {
    font-weight: 600;
    color: #ffffff;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

footer ul li {
    margin-bottom: 0.75rem;
}

footer a {
    font-size: 0.85rem;
    color: #ffffff !important;
    opacity: 0.9;
    transition: all 0.2s ease-in-out;
}

footer a:hover {
    color: #ffd700 !important;
    opacity: 1;
    text-decoration: none !important;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

footer hr {
    background-color: #636e72 !important;
    opacity: 1;
    margin: 1.5rem 0;
    border: 0;
    height: 1px;
}

footer p {
    font-size: 0.85rem;
    color: #b2bec3;
    margin-bottom: 0;
}

footer p a {
    color: #d4af37 !important;
    font-size: 0.85rem;
}

/* 确保页面高度至少为100% */
html {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
}

main {
    flex: 1;
}

nav {
    flex-shrink: 0;
}

footer {
    flex-shrink: 0;
}
