/* 画廊容器 */
.gallery-container {
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 50px;
}

.gallery-header {
    text-align: center;
    margin-bottom: 40px;
}

.gallery-header h1 {
    font-size: 2.5em;
    color: #2C3E50;
    margin-bottom: 25px;
}

/* 上传按钮样式 */
.upload-trigger-btn {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 25px;
    font-size: 14px;
    cursor: pointer;
    font-family: var(--font-family);
    transition: all 0.2s;
    margin-bottom: 20px;
    display: inline-block;
}

.upload-trigger-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 87, 34, 0.3);
}

/* 搜索框样式 */
.search-section {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.search-box {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.search-box input {
    width: 100%;
    padding: 12px 20px 12px 45px;
    border: 2px solid #E0E0E0;
    border-radius: 30px;
    font-family: var(--font-family);
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
    box-sizing: border-box;
}

.search-box input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.2);
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
}

/* 筛选按钮组 */
.filter-group {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 6px 16px;
    border: 1px solid #E0E0E0;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    font-family: var(--font-family);
    transition: all 0.2s;
    color: #666;
    font-size: 13px;
}

.filter-btn:hover, .filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 网格布局 */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

/* 卡片样式 */
.gallery-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.gallery-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.card-header {
    padding: 10px 15px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #f9f9f9;
}

.author-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
}

.author-info {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-weight: 600;
    font-size: 13px;
    color: #333;
}

.upload-time {
    font-size: 10px;
    color: #AAA;
}

/* 图片区域 */
.card-image-container {
    width: 100%;
    height: 220px;
    overflow: hidden;
    background-color: #f0f0f0;
    position: relative;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    cursor: pointer; /* 提示可点击 */
}

.gallery-card:hover .card-image {
    transform: scale(1.05);
}

.card-footer {
    padding: 15px;
}

/* 标签区域 */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.tag-badge {
    font-size: 11px;
    background-color: #f1f8e9;
    color: var(--primary-color);
    padding: 3px 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

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

.card-caption {
    font-size: 14px;
    color: #444;
    line-height: 1.5;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* 限制显示两行，多余省略 */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 10px;
    border-top: 1px solid #f5f5f5;
}

.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #999;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-family);
}

.action-btn:hover, .action-btn.liked {
    color: #ff4757;
}

.like-count {
    font-size: 13px;
}

/* =========================================
   上传弹窗样式
   ========================================= */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 500px;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.show .modal-content {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.modal-header h3 {
    margin: 0;
    color: #333;
}

.close-modal {
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
    font-size: 13px;
}

.form-group input[type="text"], 
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: var(--font-family);
    box-sizing: border-box;
}

.file-upload-wrapper {
    position: relative;
    border: 2px dashed #ddd;
    padding: 20px;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.file-upload-wrapper:hover {
    border-color: var(--primary-color);
}

.file-upload-wrapper input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.submit-btn {
    width: 100%;
    padding: 12px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 10px;
}

/* 警告框样式 */
.test-warning-box {
    background-color: #fff3cd;
    border: 1px solid #ffeeba;
    color: #856404;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 13px;
    line-height: 1.5;
}

/* =========================================
   大图详情弹窗样式
   ========================================= */
.image-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 3000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-modal-overlay.show {
    display: flex;
    opacity: 1;
}

.image-modal-container {
    background: white;
    width: 100%;
    max-width: 1100px;
    height: 90vh;
    display: flex;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.image-modal-overlay.show .image-modal-container {
    transform: scale(1);
}

.image-modal-left {
    flex: 3;
    background-color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.image-modal-left img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.image-modal-right {
    flex: 2;
    padding: 30px;
    display: flex;
    flex-direction: column;
    background: #fff;
    overflow-y: auto;
    position: relative;
}

.close-detail-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    z-index: 10;
}

.detail-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
    margin-bottom: 20px;
    padding-left: 0;
}

.detail-section {
    margin-bottom: 25px;
}

.detail-section h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.detail-caption-text {
    font-size: 15px;
    line-height: 1.6;
    color: #333;
    white-space: pre-wrap;
}

.detail-actions {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.detail-like-btn {
    color: #ff4757;
    font-size: 16px;
}

@media (max-width: 768px) {
    .image-modal-container {
        flex-direction: column;
        height: auto;
        max-height: 95vh;
    }
    .image-modal-left {
        height: 50vh;
        flex: none;
    }
    .image-modal-right {
        flex: auto;
        max-height: 45vh;
        padding: 20px;
    }
}