/**
 * 媒体中心「记忆宝盒」样式
 * 照片像珍藏的记忆碎片，散落在复古相册中
 */

/* ==================== 标签切换 ==================== */
.media-tabs {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    margin-bottom: 30px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 30px;
    backdrop-filter: blur(10px);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.media-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border: none;
    background: transparent;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    transform: none;
}

.media-tab:hover {
    background: rgba(212, 165, 116, 0.2);
    color: var(--primary);
}

.media-tab.active {
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    color: #fff;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

/* ==================== 上传区域 ==================== */
.upload-zone {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.8), rgba(245, 240, 235, 0.9));
    border: 2px dashed rgba(212, 165, 116, 0.5);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.upload-zone::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--secondary), var(--accent), var(--secondary));
    background-size: 200% 100%;
    animation: gradient-flow 3s linear infinite;
}

@keyframes gradient-flow {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.upload-zone:hover {
    border-color: var(--secondary);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.15);
}

.upload-zone-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.upload-zone-text {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* ==================== 照片墙 - 记忆碎片布局 ==================== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    padding: 10px;
    perspective: 1000px;
}

/* ==================== 记忆碎片卡片 ==================== */
.gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.1),
        0 0 0 1px rgba(212, 165, 116, 0.2);
}

/* 随机旋转角度 - 模拟散落效果 */
.gallery-item:nth-child(3n+1) { transform: rotate(-2deg); }
.gallery-item:nth-child(3n+2) { transform: rotate(1deg); }
.gallery-item:nth-child(3n+3) { transform: rotate(-1deg); }

.gallery-item:hover {
    transform: rotate(0deg) scale(1.05) translateY(-5px);
    box-shadow:
        0 15px 35px rgba(0, 0, 0, 0.2),
        0 0 0 3px rgba(243, 156, 18, 0.3);
    z-index: 10;
}

.gallery-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    filter: sepia(0.1) contrast(1.05);
    transition: filter 0.3s ease;
}

.gallery-item:hover img {
    filter: sepia(0) contrast(1.1);
}

/* 照片边角装饰 */
.gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    pointer-events: none;
    z-index: 2;
}

/* 底部渐变遮罩 */
.gallery-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.4), transparent);
    pointer-events: none;
    z-index: 1;
}

/* ==================== 照片名称标签 ==================== */
.gallery-overlay {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    color: #fff;
    font-size: 0.85rem;
    font-family: 'ZCOOL XiaoWei', serif;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    z-index: 3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
    transform: translateY(0);
}

/* ==================== 操作按钮 ==================== */
.gallery-item .download-btn,
.gallery-item .like-media-btn,
.gallery-item .delete-photo-btn {
    position: absolute;
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.gallery-item:hover .download-btn,
.gallery-item:hover .like-media-btn,
.gallery-item:hover .delete-photo-btn {
    opacity: 1;
    transform: scale(1);
}

.download-btn {
    top: 10px;
    right: 10px;
}

.download-btn:hover {
    background: var(--secondary);
    color: #fff;
}

.like-media-btn {
    bottom: 10px;
    right: 10px;
}

.like-media-btn.liked {
    color: #e74c3c;
}

/* 视频卡片的点赞按钮 - 横向排列，不大不小 */
.video-card .like-media-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    right: auto;
    bottom: auto;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    border: none;
    border-radius: 16px;
    padding: 6px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: white;
    font-size: 0.75rem;
    transition: all 0.2s ease;
    z-index: 10;
    opacity: 1;
    transform: scale(1);
    box-shadow: none;
    width: auto;
    height: auto;
}

.video-card .like-media-btn:hover {
    background: rgba(231, 76, 60, 0.8);
    transform: scale(1.05);
}

.video-card .like-media-btn.liked {
    background: #e74c3c;
    color: #fff;
}

.video-card .like-media-btn .like-icon {
    font-size: 0.85rem;
}

.like-media-btn.liked .like-icon {
    content: '❤️';
}

.delete-photo-btn {
    top: 10px;
    left: 10px;
    background: rgba(231, 76, 60, 0.9);
    color: #fff;
}

.delete-photo-btn:hover {
    background: #c0392b;
}

/* ==================== 空状态 ==================== */
.gallery-grid .empty-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.6), rgba(245, 240, 235, 0.8));
    border-radius: 20px;
    border: 2px dashed rgba(212, 165, 116, 0.3);
}

.gallery-grid .empty-message p {
    font-size: 1rem;
    color: var(--text-light);
}

.gallery-grid .empty-message p:first-child {
    font-size: 3rem;
    margin-bottom: 15px;
}

/* ==================== 入场动画 ==================== */
@keyframes memory-arrive {
    0% {
        opacity: 0;
        transform: translateY(30px) rotate(-5deg) scale(0.9);
    }
    60% {
        transform: translateY(-5px) rotate(2deg) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) rotate(0deg) scale(1);
    }
}

.gallery-item {
    animation: memory-arrive 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
}

.gallery-item:nth-child(1) { animation-delay: 0.05s; }
.gallery-item:nth-child(2) { animation-delay: 0.1s; }
.gallery-item:nth-child(3) { animation-delay: 0.15s; }
.gallery-item:nth-child(4) { animation-delay: 0.2s; }
.gallery-item:nth-child(5) { animation-delay: 0.25s; }
.gallery-item:nth-child(6) { animation-delay: 0.3s; }
.gallery-item:nth-child(7) { animation-delay: 0.35s; }
.gallery-item:nth-child(8) { animation-delay: 0.4s; }
.gallery-item:nth-child(9) { animation-delay: 0.45s; }
.gallery-item:nth-child(10) { animation-delay: 0.5s; }

/* ==================== 视频卡片 ==================== */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    padding: 10px;
}

.video-card {
    background: linear-gradient(145deg, #fff, #faf8f5);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
}

.video-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.video-placeholder {
    width: 100%;
    height: 160px;
    background: linear-gradient(135deg, #2c3e50, #1a252f);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.video-placeholder::before {
    content: '';
    position: absolute;
    width: 60px;
    height: 60px;
    background: rgba(231, 76, 60, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-placeholder::after {
    content: '▶';
    position: absolute;
    font-size: 1.5rem;
    color: #fff;
    z-index: 1;
}

.video-info {
    padding: 16px;
}

.video-title {
    font-family: 'ZCOOL XiaoWei', serif;
    font-size: 1rem;
    color: var(--primary);
    margin-bottom: 8px;
}

.video-meta {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* ==================== 移动端适配 ==================== */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
        padding: 5px;
    }

    .gallery-item img {
        height: 140px;
    }

    .media-tabs {
        gap: 6px;
        padding: 8px 6px;
    }

    .media-tab {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }

    .upload-zone {
        padding: 20px;
    }

    .upload-zone-icon {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .gallery-item img {
        height: 120px;
    }

    .gallery-item::before {
        border-width: 2px;
    }
}

/* ==================== 校友会卡片 ==================== */
.alumni-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    padding: 20px 0;
}

.alumni-card {
    position: relative;
    background: linear-gradient(145deg, #f5f0e6 0%, #ebe4d4 100%);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.1),
        inset 0 0 30px rgba(139, 119, 101, 0.1);
}

.alumni-card:hover {
    transform: translateY(-5px) rotate(0.5deg);
    box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.2),
        inset 0 0 30px rgba(139, 119, 101, 0.05);
}

.alumni-image {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

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

.alumni-card:hover .alumni-image img {
    transform: scale(1.08);
}

.alumni-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.alumni-content {
    padding: 16px;
    position: relative;
}

.alumni-location {
    display: inline-block;
    padding: 4px 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    font-size: 0.75rem;
    margin-bottom: 10px;
}

.alumni-title {
    font-family: 'ZCOOL XiaoWei', serif;
    font-size: 1.1rem;
    color: #2c3e50;
    margin: 0 0 10px 0;
    line-height: 1.4;
    font-weight: normal;
    word-break: break-word;
}

.alumni-desc {
    font-size: 0.85rem;
    color: #5d6d7e;
    line-height: 1.6;
    margin: 0 0 12px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.alumni-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px dashed rgba(139, 119, 101, 0.3);
}

.alumni-date {
    font-size: 0.75rem;
    color: #8b7355;
}

/* 校友会卡片动画 */
@keyframes alumni-arrive {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.alumni-card {
    animation: alumni-arrive 0.5s ease-out backwards;
}

.alumni-card:nth-child(1) { animation-delay: 0.05s; }
.alumni-card:nth-child(2) { animation-delay: 0.1s; }
.alumni-card:nth-child(3) { animation-delay: 0.15s; }
.alumni-card:nth-child(4) { animation-delay: 0.2s; }
.alumni-card:nth-child(5) { animation-delay: 0.25s; }
.alumni-card:nth-child(6) { animation-delay: 0.3s; }
.alumni-card:nth-child(7) { animation-delay: 0.35s; }
.alumni-card:nth-child(8) { animation-delay: 0.4s; }

/* 校友会区域标题 */
.alumni-section-title {
    font-family: 'ZCOOL XiaoWei', serif;
    font-size: 1.3rem;
    color: #2c3e50;
    margin: 30px 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px dashed rgba(212, 165, 116, 0.4);
}

/* 校友会联系人卡片 */
.alumni-association {
    background: linear-gradient(145deg, #f8f4ed 0%, #ede5d8 100%);
    border: 2px solid rgba(212, 165, 116, 0.3);
}

.alumni-association .alumni-image-placeholder {
    background: linear-gradient(135deg, #f39c12 0%, #e74c3c 100%);
}

.alumni-location-badge {
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-bottom: 10px;
}

.alumni-association .alumni-title {
    color: #c0392b;
    font-size: 1.15rem;
}

.alumni-contact {
    margin-top: 12px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 8px;
}

.contact-item {
    font-size: 0.8rem;
    color: #5d6d7e;
    margin: 4px 0;
    line-height: 1.5;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .alumni-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }

    .alumni-image {
        height: 140px;
    }

    .alumni-content {
        padding: 12px;
    }

    .alumni-title {
        font-size: 0.95rem;
    }

    .alumni-section-title {
        font-size: 1.1rem;
        margin: 20px 0 15px 0;
    }
}

@media (max-width: 480px) {
    .alumni-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .alumni-image {
        height: 160px;
    }

    .alumni-section-title {
        font-size: 1rem;
    }

    .contact-item {
        font-size: 0.75rem;
    }
}
