/* 绘画作品页面样式 */

.paintings-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.paintings-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.paintings-header h1 {
    font-size: 3.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.paintings-header .subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 300;
    letter-spacing: 0.05em;
}

/* 画廊展示区域 */
.paintings-gallery {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 3rem;
    min-height: 500px;
}

.gallery-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.gallery-wrapper {
    display: flex;
    transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
    will-change: transform;
}

.painting-item {
    min-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0.7;
    transform: scale(0.9);
    transition: all 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
    padding: 1rem;
}

.painting-item.active {
    opacity: 1;
    transform: scale(1);
}

.painting-item.prev,
.painting-item.next {
    opacity: 0.4;
    transform: scale(0.75);
}

.painting-image {
    width: 100%;
    max-width: 600px;
    aspect-ratio: 4/3;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 
        0 20px 40px rgba(46, 66, 72, 0.15),
        0 8px 16px rgba(46, 66, 72, 0.1);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
}

.painting-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.1) 0%,
        transparent 50%,
        rgba(0, 0, 0, 0.05) 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.painting-image:hover::before {
    opacity: 1;
}

.painting-image:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 30px 60px rgba(46, 66, 72, 0.2),
        0 12px 24px rgba(46, 66, 72, 0.15);
}

.painting-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.painting-image:hover img {
    transform: scale(1.05);
}

.painting-info {
    text-align: center;
    margin-top: 1.5rem;
    padding: 0 1rem;
}

.painting-info h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.painting-medium {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 0.3rem;
}

.painting-date {
    color: var(--accent-color);
    font-size: 0.9rem;
    font-weight: 500;
}

/* 导航按钮样式 */
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border: none;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--card-color);
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(46, 66, 72, 0.2);
    z-index: 10;
    outline: none; /* 防止焦点轮廓 */
    user-select: none; /* 防止选择 */
}

.gallery-nav:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 16px rgba(46, 66, 72, 0.3);
}

.gallery-nav:active {
    transform: translateY(-50%) scale(0.95);
}

.gallery-nav:focus {
    outline: none; /* 确保焦点时不会影响布局 */
}

.gallery-nav.prev-btn {
    left: -25px;
}

.gallery-nav.next-btn {
    right: -25px;
}

.gallery-nav:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: translateY(-50%);
}

.gallery-nav:disabled:hover {
    transform: translateY(-50%);
    box-shadow: 0 4px 12px rgba(46, 66, 72, 0.2);
}

/* 绘画详情信息 */
.painting-details {
    background: var(--card-color);
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--box-shadow);
    border: 1px solid var(--border-color);
}

.details-content h2 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.details-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.meta-item {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.meta-item strong {
    color: var(--primary-color);
}

.details-content p {
    color: var(--text-color);
    line-height: 1.6;
    font-size: 1.1rem;
}

/* 缩略图导航 */
.thumbnails-container {
    overflow-x: auto;
    padding: 1rem 0;
    touch-action: pan-x; /* 只允许水平滚动 */
    scrollbar-width: thin;
}

.thumbnails-wrapper {
    display: flex;
    gap: 1rem;
    padding: 0.5rem;
    min-width: max-content;
}

.thumbnail-item {
    width: 80px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    opacity: 0.6;
}

.thumbnail-item:hover {
    opacity: 0.8;
    transform: scale(1.05);
}

.thumbnail-item.active {
    opacity: 1;
    border-color: var(--accent-color);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(74, 157, 156, 0.3);
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 全屏图片查看器 */
.fullscreen-viewer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: none;
    background: rgba(0, 0, 0, 0.95);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.fullscreen-viewer.show {
    display: flex;
    opacity: 1;
}

.viewer-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
}

.viewer-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.viewer-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2001;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.viewer-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.viewer-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2001;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.viewer-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.viewer-prev {
    left: 20px;
}

.viewer-next {
    right: 20px;
}

.viewer-image-container {
    position: relative;
    width: calc(100% - 160px);
    height: calc(100% - 120px);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 80px;
}

.viewer-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

.viewer-info {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    text-align: center;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px 25px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    min-width: 300px;
}

.viewer-info h3 {
    margin: 0 0 8px 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.viewer-meta {
    display: flex;
    gap: 15px;
    justify-content: center;
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 8px;
}

.viewer-counter {
    font-size: 0.85rem;
    opacity: 0.7;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .viewer-close {
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .viewer-nav {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .viewer-prev {
        left: 15px;
    }

    .viewer-next {
        right: 15px;
    }

    .viewer-image-container {
        width: calc(100% - 130px);
        height: calc(100% - 160px);
        margin: 0 65px;
    }

    .viewer-info {
        bottom: 15px;
        padding: 12px 20px;
        min-width: 250px;
        max-width: calc(100% - 40px);
    }

    .viewer-info h3 {
        font-size: 1.1rem;
    }

    .viewer-meta {
        flex-direction: column;
        gap: 5px;
        font-size: 0.85rem;
    }
}

/* 横屏模式适配 */
@media (max-height: 500px) and (orientation: landscape) {
    .viewer-info {
        position: absolute;
        bottom: 10px;
        padding: 8px 15px;
        font-size: 0.8rem;
    }

    .viewer-info h3 {
        font-size: 1rem;
        margin-bottom: 5px;
    }

    .viewer-meta {
        gap: 10px;
        font-size: 0.75rem;
    }

    .viewer-counter {
        font-size: 0.75rem;
    }

    .viewer-close {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }

    .viewer-nav {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }

    .viewer-image-container {
        height: calc(100% - 80px);
    }
}

/* 超小屏幕适配 */
@media (max-width: 480px) {
    .viewer-image-container {
        width: calc(100% - 100px);
        margin: 0 50px;
    }

    .viewer-nav {
        width: 45px;
        height: 45px;
    }

    .viewer-prev {
        left: 10px;
    }

    .viewer-next {
        right: 10px;
    }

    .viewer-info {
        min-width: 200px;
        padding: 10px 15px;
    }
}

.modal-info {
    color: white;
    text-align: center;
    max-width: 600px;
}

.modal-info h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--card-color);
}

.modal-info p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.9);
}

.modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.modal-meta span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

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

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.7) translateY(50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 滚动条自定义样式 */
.thumbnails-container::-webkit-scrollbar {
    height: 6px;
}

.thumbnails-container::-webkit-scrollbar-track {
    background: var(--border-color);
    border-radius: 3px;
}

.thumbnails-container::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 3px;
}

.thumbnails-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .paintings-container {
        padding: 1rem;
    }

    .paintings-header h1 {
        font-size: 2.5rem;
    }

    .paintings-gallery {
        min-height: 400px;
    }

    .painting-image {
        max-width: 90%;
    }

    .gallery-nav {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .prev-btn {
        left: 1rem;
    }

    .next-btn {
        right: 1rem;
    }

    .painting-details {
        padding: 1.5rem;
    }

    .details-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .modal-content {
        max-width: 95vw;
        max-height: 95vh;
    }

    .framed-painting {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }

    .painting-frame {
        padding: 1rem;
    }

    .modal-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .thumbnails-wrapper {
        gap: 0.5rem;
    }

    .thumbnail-item {
        width: 60px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .paintings-header h1 {
        font-size: 2rem;
    }

    .painting-info h3 {
        font-size: 1.2rem;
    }

    .details-content h2 {
        font-size: 1.5rem;
    }

    .framed-painting {
        padding: 1rem;
    }

    .painting-frame {
        padding: 0.5rem;
    }
}

/* 主画作显示区 */
.main-painting-display {
    display: flex;
    gap: 3rem;
    align-items: flex-start;
    margin-bottom: 2rem;
    touch-action: pan-y; /* 只允许垂直滚动 */
}

/* 画作查看器 */
.painting-viewer {
    flex: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 500px;
    background: linear-gradient(135deg, var(--sidebar-bg), var(--card-color));
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(46, 66, 72, 0.15);
    cursor: pointer;
    transition: all 0.3s ease;
    touch-action: manipulation; /* 优化触摸体验 */
    user-select: none; /* 防止选择文本 */
}


