:root {
    --primary-color: #4a6fa5;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --dark-bg: #1a1d20;
    --card-bg: #2d3136;
    --border-color: #3a3f44;
}

::selection {
    background-color: #2563eb33;
    color: inherit;
}

body {
    background: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: all 0.3s ease;
}

.header-container {
    background: rgba(26, 29, 32, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.site-header {
    padding: 1.5rem 0;
    text-align: center;
}

.site-title {
    font-size: 2.2rem;
    font-weight: 700;
    background: linear-gradient(45deg, #4a6fa5, #6a9eff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.site-subtitle {
    color: #adb5bd;
    font-size: 1rem;
    font-weight: 300;
}

.subject-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.subject-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    border-color: var(--primary-color);
}

.subject-header {
    background: linear-gradient(90deg, rgba(74, 111, 165, 0.1), rgba(74, 111, 165, 0.05));
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.subject-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #e9ecef;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.subject-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(74, 111, 165, 0.2);
    color: #4a6fa5;
}

.book-count {
    background: rgba(108, 117, 125, 0.3);
    color: #adb5bd;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
}

.book-list {
    padding: 1rem;
}

.book-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    transition: all 0.2s ease;
    overflow: hidden;
}

.book-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(74, 111, 165, 0.3);
}

.book-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    text-align: left;
    width: 100%;
    background: transparent;
    border: none;
    color: #e9ecef;
    transition: all 0.2s ease;
}

.book-btn:hover {
    color: #fff;
}

.book-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.book-icon {
    color: #4a6fa5;
    font-size: 1.25rem;
    min-width: 24px;
}

.book-title {
    font-weight: 500;
    line-height: 1.4;
}

.book-grade {
    color: #adb5bd;
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.book-status {
    font-size: 0.85rem;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    white-space: nowrap;
}

.status-available {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
}

.status-unavailable {
    background: rgba(108, 117, 125, 0.2);
    color: #adb5bd;
}

.status-testing {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.status-new {
    background: rgba(23, 162, 184, 0.2);
    color: #17a2b8;
}

.recommendation-card {
    background: linear-gradient(135deg, rgba(74, 111, 165, 0.1), rgba(106, 158, 255, 0.05));
    border: 1px solid rgba(74, 111, 165, 0.3);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.badge-verified {
    background: linear-gradient(45deg, #28a745, #20c997);
    color: white;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0.75rem;
}

.footer {
    background: rgba(26, 29, 32, 0.8);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2rem 0;
    margin-top: 3rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-item {
    text-align: center;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #4a6fa5;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #adb5bd;
    font-size: 0.95rem;
}

@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .book-btn {
        padding: 0.875rem 1rem;
    }

    .book-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .book-status {
        align-self: flex-start;
        margin-top: 0.5rem;
    }
}

/* 模态框样式优化 - 修复关闭问题并优化全屏动画 */
.modal-mask {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 1010;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-mask.show {
    opacity: 1;
}

.modal-content {
    width: 95%;
    height: 90%;
    background: #1a1d20;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.95);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-mask.show .modal-content {
    transform: scale(1);
}

/* 优化全屏动画 */
.modal-content.fullscreen {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
}

/* 优化按钮样式 - 提高白色背景下的对比度 */
.close-btn,
.fullscreen-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1011;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    opacity: 0.9;
}

.fullscreen-btn {
    right: 5.5rem;
}

.close-btn:hover,
.fullscreen-btn:hover {
    background: rgba(0, 0, 0, 0.85);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.15) translateY(-2px);
    opacity: 1;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.4);
}

.close-btn:active,
.fullscreen-btn:active {
    transform: scale(1.05);
    transition: transform 0.1s ease;
}

/* 添加按钮悬停提示效果 */
.close-btn::after,
.fullscreen-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1001;
}

.close-btn:hover::after,
.fullscreen-btn:hover::after {
    opacity: 1;
}

/* 优化PDF容器 */
.pdf-iframe {
    width: 100%;
    height: 100%;
    border: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.pdf-iframe.loaded {
    opacity: 1;
}

/* 添加全屏过渡效果 */
@keyframes fadeInFullscreen {
    from {
        opacity: 0.9;
        transform: scale(0.98);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.fullscreen-transition {
    animation: fadeInFullscreen 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeInUp 0.6s ease forwards;
}

.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}

.delay-4 {
    animation-delay: 0.4s;
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: rgba(74, 111, 165, 0.5);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(74, 111, 165, 0.7);
}

/* 添加全屏指示器 */
.fullscreen-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1.1rem;
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.fullscreen-indicator.show {
    opacity: 1;
    animation: pulseIndicator 0.5s ease 1;
}

@keyframes pulseIndicator {
    0% {
        transform: translate(-50%, -50%) scale(0.9);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.05);
    }

    100% {
        transform: translate(-50%, -50%) scale(1);
    }
}