/* ==================== 导航栏 ==================== */

.navbar {
    background: linear-gradient(90deg, #9B59B6, #3498DB);
    color: white;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.2);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.nav-title {
    font-size: 1.8rem;
    text-align: center;
    flex: 1;
    font-weight: 600;
}

.nav-back, .nav-home {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid white;
    color: white;
    padding: 10px 15px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.nav-back:hover, .nav-home:hover {
    background: white;
    color: #9B59B6;
    transform: scale(1.05);
}

/* ==================== 主要内容 ==================== */

.gallery-main {
    min-height: 100vh;
    padding: 40px 20px;
    background: linear-gradient(135deg, #f5e6ff 0%, #e6f2ff 50%, #ffe6f2 100%);
}

/* 覆盖 style.css 里的全局 .container（它是 flex 水平排列，在这里要改成纵向块） */
.gallery-main .container {
    display: block;
    min-height: unset;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0;
}

.gallery-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.gallery-description {
    max-width: 700px;
    margin: 0;
    color: #6d5c74;
    line-height: 1.6;
}

.upload-artwork-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 10px 20px;
    border-radius: 999px;
    background: linear-gradient(90deg, #e91e63, #9b59b6);
    color: white;
    text-decoration: none;
    font-weight: 700;
    box-shadow: 0 5px 16px rgba(155, 89, 182, 0.25);
}

.upload-artwork-btn:hover {
    transform: translateY(-2px);
}

@media (max-width: 650px) {
    .gallery-actions {
        align-items: stretch;
        flex-direction: column;
    }
}

/* ==================== 筛选区域（顶部横向） ==================== */

.filter-section {
    background: white;
    border-radius: 20px;
    padding: 22px 30px;
    margin-bottom: 36px;
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.1);
    border: 2px solid rgba(155, 89, 182, 0.08);
    display: flex;
    align-items: center;
    gap: 30px;
}

/* 左侧：时间排序 */
.filter-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 0 0 160px;
}

.filter-left label,
.filter-right label {
    font-weight: 600;
    color: #9B59B6;
    font-size: 0.95rem;
    white-space: nowrap;
}

.sort-select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #3498DB;
    border-radius: 10px;
    font-size: 0.95rem;
    background: white;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sort-select:hover {
    border-color: #9B59B6;
    box-shadow: 0 2px 8px rgba(155, 89, 182, 0.2);
}

/* 分隔线 */
.filter-section::after {
    content: '';
    display: none;
}

/* 右侧：媒介分类 */
.filter-right {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.filter-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    background: white;
    border: 2px solid #E0E0E0;
    color: #555;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.25s ease;
    font-size: 0.9rem;
    white-space: nowrap;
}

.filter-btn:hover {
    border-color: #9B59B6;
    color: #9B59B6;
    transform: translateY(-2px);
}

.filter-btn.active {
    background: linear-gradient(90deg, #3498DB, #9B59B6);
    color: white;
    border-color: transparent;
    box-shadow: 0 3px 10px rgba(155, 89, 182, 0.3);
}

/* ==================== 作品网格（固定2列） ==================== */

.artworks-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
    margin-bottom: 40px;
}

/* ==================== 作品卡片 ==================== */

.artwork-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(155, 89, 182, 0.12);
    transition: all 0.3s ease;
    cursor: pointer;
    animation: fadeIn 0.6s ease-out;
}

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

.artwork-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 35px rgba(155, 89, 182, 0.25);
}

/* 作品图片容器 */
.artwork-image {
    position: relative;
    width: 100%;
    height: 380px;
    background: linear-gradient(135deg, #f9f5ff, #f0e6ff);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.artwork-card:hover .artwork-image img {
    transform: scale(1.1);
}

/* 图片覆盖层 */
.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(155, 89, 182, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.artwork-card:hover .image-overlay {
    opacity: 1;
}

.view-detail {
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    animation: slideRight 0.3s ease-out;
}

@keyframes slideRight {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 作品信息 */
.artwork-info {
    padding: 20px;
}

.artwork-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.artwork-date {
    color: #888;
    font-size: 0.95rem;
    margin-bottom: 12px;
}

/* 作品标签 */
.artwork-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.medium-tag {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 12px;
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
}

.category-tag {
    color: #ffffff;
    background: linear-gradient(90deg, #6f4b8b, #4d78a8) !important;
}

.filter-right[hidden] {
    display: none;
}

/* ==================== 占位符卡片 ==================== */

.artwork-card.placeholder {
    background: linear-gradient(135deg, #f9f5ff 0%, #f0e6ff 100%);
    border: 3px dashed rgba(155, 89, 182, 0.3);
    cursor: default;
}

.artwork-card.placeholder:hover {
    transform: none;
    box-shadow: 0 6px 20px rgba(155, 89, 182, 0.12);
}

.coming-soon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 15px;
    color: #9B59B6;
}

.soon-icon {
    font-size: 3rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

.coming-soon p {
    font-weight: 600;
    font-size: 1.1rem;
}

/* ==================== 加载更多 ==================== */

.load-more {
    text-align: center;
    padding: 30px;
    color: #9B59B6;
    font-size: 1.1rem;
    font-weight: 500;
}

/* 触摸设备：给卡片加点击反馈 */
.artwork-card:active {
    transform: scale(0.98);
    box-shadow: 0 4px 12px rgba(155, 89, 182, 0.2);
}

/* ==================== 响应式设计 ==================== */

/* 平板（≤900px）：筛选栏竖排 */
@media (max-width: 900px) {
    .filter-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding: 20px;
    }

    .filter-left {
        flex: none;
        width: 100%;
        flex-direction: row;
        align-items: center;
        gap: 12px;
    }

    .filter-left label { white-space: nowrap; }
    .sort-select { flex: 1; }
    .artwork-image { height: 300px; }
}

/* 手机（≤768px）：单列显示 ← 核心改动 */
@media (max-width: 768px) {
    .artworks-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .artwork-image {
        height: auto;
        aspect-ratio: 4 / 3;
    }

    .gallery-main { padding: 16px 12px; }

    .nav-title { font-size: 1.4rem; }

    /* 手机上隐藏 hover 提示，改用 active 反馈 */
    .artwork-card:hover {
        transform: none;
        box-shadow: 0 6px 20px rgba(155, 89, 182, 0.12);
    }
    .artwork-card:hover .artwork-image img { transform: none; }
    .artwork-card:hover .image-overlay { opacity: 0; }
    .artwork-card:active { transform: scale(0.98); }
}

/* 小屏手机（≤480px）：进一步收紧 */
@media (max-width: 480px) {
    .gallery-main { padding: 12px 10px; }

    .filter-section {
        padding: 15px 12px;
        border-radius: 14px;
        margin-bottom: 16px;
    }

    .filter-btn {
        padding: 6px 12px;
        font-size: 0.82rem;
    }

    .artwork-card { border-radius: 14px; }

    .artwork-info { padding: 14px; }

    .artwork-title { font-size: 1.1rem; }

    .nav-title { font-size: 1.2rem; }

    .nav-back, .nav-home {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
}

/* 超小屏（≤375px，iPhone SE 等） */
@media (max-width: 375px) {
    .artworks-grid { gap: 12px; }

    .filter-section { padding: 12px 10px; }

    .artwork-title { font-size: 1rem; }

    .nav-title { font-size: 1.1rem; }
}
