/* =============================================
 * MangaShelf 自定义样式
 * =============================================
 */

/* 全局样式 */
:root {
    --primary-color: #4e73e5;
    --success-color: #28a745;
    --info-color: #17a2b8;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
}

body {
    background-color: var(--light-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* 容器样式 */
.container {
    max-width: 1200px;
}

/* 导航栏样式 */
.navbar {
    background-color: var(--primary-color) !important;
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.2rem;
}

.nav-link {
    color: white !important;
    font-weight: 500;
}

.nav-link:hover {
    color: rgba(255, 255, 255, 0.9) !important;
}

.nav-link.active {
    color: white !important;
    border-bottom: 2px solid white;
}

/* 卡片样式 */
.card {
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: var(--primary-color);
    color: white;
    font-weight: bold;
    border-radius: 8px 8px 0 0;
}

/* 按钮样式 */
.btn {
    border-radius: 6px;
    padding: 8px 20px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: linear-gradient(135deg, #4e73e5 0%, #3b6cb8 100%);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #3b6cb8 0%, #3498db 100%);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    border: none;
}

.btn-success:hover {
    background: linear-gradient(135deg, #218838 0%, #1a7f37 100%);
}

.btn-warning {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    border: none;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #e0a800 0%, #c77b00 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #b02a37 100%);
    border: none;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #b02a37 0%, #a01e26 100%);
}

/* 表格样式 */
.table {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
}

.table thead {
    background-color: var(--primary-color);
    color: white;
}

.table thead th {
    border: none;
    padding: 15px;
    font-weight: 600;
    background-color: var(--primary-color) !important;
    color: white !important;
    box-shadow: inset 0 0 0 9999px var(--primary-color);
}

.table tbody tr {
    transition: background-color 0.2s;
}

.table tbody tr:hover {
    background-color: var(--light-color);
}

/* 分页样式 */
.pagination {
    margin-top: 20px;
}

.page-link {
    color: var(--primary-color);
    font-weight: 500;
    border: 1px solid var(--primary-color);
    margin: 0 5px;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.3s;
}

.page-link:hover {
    background-color: var(--primary-color);
    color: white;
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    color: white;
}

.page-item.disabled .page-link {
    color: #ccc;
    border-color: #ccc;
    cursor: not-allowed;
}

/* 徽章样式 */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.8rem;
}

.badge-primary {
    background-color: var(--primary-color);
    color: white;
}

.badge-success {
    background-color: var(--success-color);
    color: white;
}

.badge-info {
    background-color: var(--info-color);
    color: white;
}

.badge-warning {
    background-color: var(--warning-color);
    color: white;
}

.badge-danger {
    background-color: var(--danger-color);
    color: white;
}

.badge-secondary {
    background-color: #6c757d;
    color: white;
}

/* 进度条样式 */
.progress {
    background-color: #e9ecef;
    border-radius: 10px;
    height: 20px;
    overflow: hidden;
}

.progress-bar {
    background-color: var(--primary-color);
    height: 100%;
    transition: width 0.3s;
}

/* 表单样式 */
.form-control {
    border-radius: 6px;
    padding: 10px 15px;
    border: 2px solid #e9ecef;
    transition: all 0.3s;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
}

.form-select {
    border-radius: 6px;
    padding: 10px 15px;
    border: 2px solid #e9ecef;
    background-color: white;
}

/* 漫画卡片样式 */
.manga-card {
    transition: all 0.3s;
    cursor: pointer;
}

.manga-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.manga-card .card-body {
    padding: 20px;
    text-align: center;
}

.manga-card h5 {
    color: var(--dark-color);
    font-weight: 600;
    margin-bottom: 10px;
}

.manga-card p {
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 5px;
}

/* 统计卡片样式 */
.stat-card {
    text-align: center;
    padding: 30px 20px;
    transition: all 0.3s;
}

.stat-card:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.stat-card h3 {
    color: var(--dark-color);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.stat-card .display-4 {
    font-size: 2rem;
    font-weight: bold;
    margin: 0;
}

/* 版本列表样式 */
.version-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

/* 订单状态样式 */
.order-status {
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-block;
}

/* 筛选表单样式 */
.filter-form {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 收藏进度样式 */
.progress-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-text {
    font-weight: 600;
    color: var(--primary-color);
}

/* 响应式布局 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .version-list {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .stat-card {
        padding: 20px 10px;
    }
}

/* 加载动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

/* 搜索框样式 */
.search-box {
    position: relative;
    margin-bottom: 20px;
}

.search-box input {
    padding-right: 40px;
}

.search-box .search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #ccc;
    pointer-events: none;
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.empty-state-text {
    font-size: 1rem;
    color: #666;
}

.featured-cover-frame {
    width: 100%;
    max-width: 220px;
    aspect-ratio: 10 / 14;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    background: linear-gradient(180deg, #f7f9fc 0%, #eef3f8 100%);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(78, 115, 229, 0.08);
}

.featured-cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.volume-cover-gallery {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.volume-cover-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow: visible;
}

.volume-cover-group-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #2f3b52;
}

.volume-cover-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    overflow: visible;
}

.volume-cover-item {
    position: relative;
    width: 104px;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    overflow: visible;
}

.volume-cover-thumb {
    width: 104px;
    height: 146px;
    border-radius: 10px;
    overflow: hidden;
    background: linear-gradient(180deg, #edf2fb 0%, #dfe7f3 100%);
    box-shadow: 0 8px 20px rgba(39, 53, 89, 0.14);
}

.volume-cover-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.18s ease;
}

.volume-cover-item:hover .volume-cover-thumb img,
.volume-cover-item:focus-visible .volume-cover-thumb img {
    transform: scale(1.04);
}

.volume-cover-label {
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.2;
    color: #22304d;
}

.volume-cover-meta {
    font-size: 0.75rem;
    line-height: 1.2;
    color: #667089;
}

.volume-cover-preview {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 12px);
    transform: translateX(-50%) translateY(8px);
    width: 196px;
    padding: 0.55rem;
    border-radius: 14px;
    background: rgba(16, 22, 38, 0.96);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 40;
}

.volume-cover-preview img {
    width: 100%;
    aspect-ratio: 10 / 14;
    object-fit: cover;
    border-radius: 10px;
    display: block;
}

.volume-cover-preview-caption {
    display: block;
    margin-top: 0.45rem;
    font-size: 0.78rem;
    line-height: 1.3;
    color: rgba(255, 255, 255, 0.92);
}

.volume-cover-item:hover .volume-cover-preview,
.volume-cover-item:focus-visible .volume-cover-preview {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

@media (hover: none) {
    .volume-cover-preview {
        display: none;
    }
}

@media (max-width: 767.98px) {
    .volume-cover-item {
        width: 88px;
    }

    .volume-cover-thumb {
        width: 88px;
        height: 124px;
    }
}
