* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1a1a1a;
    color: #e0e0e0;
    line-height: 1.6;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

/* 返回按钮 */
.back-button {
    display: inline-block;
    margin-bottom: 20px;
    padding: 10px 20px;
    color: #ff6b9d;
    text-decoration: none;
    font-size: 16px;
    border-radius: 6px;
    transition: all 0.2s;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
}

.back-button:hover {
    background: #333;
    border-color: #ff6b9d;
}

.search-box {
    display: flex;
    gap: 10px;
}

.search-box input {
    padding: 10px;
    border: 1px solid #444;
    background: #1a1a1a;
    color: #e0e0e0;
    border-radius: 4px;
    width: 300px;
}

.search-box button {
    padding: 10px 20px;
    background: #ff6b9d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.view-toggle {
    margin-bottom: 20px;
}

.view-toggle button {
    padding: 10px 20px;
    background: #2a2a2a;
    color: #e0e0e0;
    border: 1px solid #444;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 10px;
}

.view-toggle button.active {
    background: #ff6b9d;
    border-color: #ff6b9d;
}

.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.list-view {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gallery-item {
    background: #2a2a2a;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
}

.gallery-item:hover {
    transform: translateY(-5px);
}

.gallery-item img {
    width: 100%;
    height: 280px;
    object-fit: cover;
}

.gallery-item .info {
    padding: 10px;
}

.gallery-item .title {
    font-size: 14px;
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gallery-item .meta {
    font-size: 12px;
    color: #888;
}

.list-item {
    display: flex;
    padding: 15px;
    background: #2a2a2a;
    border-radius: 8px;
    cursor: pointer;
}

.list-item:hover {
    background: #333;
}

.list-item .title {
    flex: 1;
    font-size: 16px;
}

.list-item .meta {
    color: #888;
    font-size: 14px;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.pagination button {
    padding: 10px 15px;
    background: #2a2a2a;
    color: #e0e0e0;
    border: 1px solid #444;
    border-radius: 4px;
    cursor: pointer;
}

.pagination button.active {
    background: #ff6b9d;
    border-color: #ff6b9d;
}

.pagination button:hover:not(.active) {
    background: #333;
}

@media (min-width: 1920px) {
    .grid-view {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (min-width: 3840px) {
    .grid-view {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

/* 详细页面样式 */
.gallery-detail-layout {
    display: flex;
    gap: 30px;
    margin-top: 20px;
}

.gallery-cover {
    flex: 0 0 350px;
    max-width: 350px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.cover-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* 下载按钮区域 */
.download-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.download-button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #2a2a2a;
    color: #ff6b9d;
    text-decoration: none;
    border-radius: 6px;
    border: 1px solid #3a3a3a;
    transition: all 0.2s;
    font-size: 14px;
}

.download-button:hover {
    background: #333;
    border-color: #ff6b9d;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 107, 157, 0.2);
}

.download-button .download-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.download-button .download-text {
    flex: 1;
    word-break: break-all;
}

.download-button .download-size {
    color: #888;
    font-size: 12px;
    flex-shrink: 0;
    margin-left: auto;
}

.action-buttons {
    display: flex;
    flex-direction: column; /* 纵向排列 */
    gap: 10px;
}

/* PC端元数据布局：左右分栏 */
.meta-layout {
    display: flex;
    gap: 30px;
}

.meta-left {
    flex: 0 0 300px; /* 基本信息固定宽度 */
}

.meta-right {
    flex: 1; /* 标签占据剩余空间 */
}

/* 响应式：移动端恢复单列 */
@media (max-width: 1024px) {
    .meta-layout {
        flex-direction: column;
    }
    
    .meta-left, .meta-right {
        flex: auto;
    }
}

.read-button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #ff6b9d;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    border: none;
    transition: all 0.2s;
    font-size: 14px;
    cursor: pointer;
    width: 100%;
    margin-bottom: 10px;
    font-weight: 600;
}

.read-button:hover {
    background: #ff4785;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 157, 0.4);
}

.read-button .read-icon {
    font-size: 18px;
}

.read-button .read-text {
    flex: 1;
    text-align: left;
}

/* 详细页面布局优化 */
.meta-two-col {
    display: flex;
    gap: 30px;
}

.basic-info {
    flex: 0 0 300px;
    border-right: 1px solid #3a3a3a;
    padding-right: 25px;
    border-bottom: none; /* 移除原有底部边框 */
}

.tags-panel {
    flex: 1;
    padding-top: 0; /* 移除原有顶部内边距 */
    margin-top: 0; /* 移除原有顶部外边距 */
}

/* 响应式调整 */
@media (max-width: 1024px) {
    .meta-two-col {
        flex-direction: column;
        gap: 0;
    }
    
    .basic-info {
        flex: none;
        border-right: none;
        padding-right: 0;
        border-bottom: 1px solid #3a3a3a;
        padding-bottom: 20px;
        margin-bottom: 20px;
    }
    
    .gallery-detail-layout {
        flex-direction: column;
    }
    
    .gallery-cover {
        max-width: 100%;
        flex: none;
    }
    
    .cover-image {
        max-width: 400px;
        margin: 0 auto;
    }
}

.gallery-metadata {
    flex: 1;
    background: #2a2a2a;
    border-radius: 8px;
    padding: 25px;
}

.metadata-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #3a3a3a;
}

.metadata-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.metadata-title {
    font-size: 24px;
    color: #ff6b9d;
    margin-bottom: 10px;
    line-height: 1.4;
}

.metadata-subtitle {
    font-size: 16px;
    color: #aaa;
    margin-top: 5px;
    line-height: 1.5;
}

.metadata-row {
    display: flex;
    margin-bottom: 12px;
    align-items: flex-start;
}

.metadata-row:last-child {
    margin-bottom: 0;
}

.metadata-label {
    font-weight: 600;
    color: #888;
    min-width: 120px;
    flex-shrink: 0;
}

.metadata-value {
    color: #e0e0e0;
    flex: 1;
    word-break: break-word;
}

.metadata-value a {
    color: #ff6b9d;
    text-decoration: none;
}

.metadata-value a:hover {
    text-decoration: underline;
}

.metadata-value.warning {
    color: #ff6b6b;
}

.section-title {
    font-size: 18px;
    color: #ff6b9d;
    margin-bottom: 15px;
    font-weight: 600;
}

/* 标签样式 */
.tags-section {
    margin-top: 20px;
}

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

.tag-group:last-child {
    margin-bottom: 0;
}

.tag-group-label {
    display: inline-block;
    font-weight: 600;
    color: #888;
    margin-bottom: 8px;
    font-size: 14px;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    display: inline-block;
    padding: 5px 12px;
    background: #3a3a3a;
    color: #e0e0e0;
    border-radius: 4px;
    font-size: 13px;
    border: 1px solid #4a4a4a;
    transition: all 0.2s;
    cursor: default;
}

.tag:hover {
    background: #4a4a4a;
    border-color: #ff6b9d;
}

/* 存储文件样式 */
.stored-files-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stored-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: #1a1a1a;
    border-radius: 6px;
    border: 1px solid #3a3a3a;
}

.download-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ff6b9d;
    text-decoration: none;
    flex: 1;
    word-break: break-all;
}

.download-link:hover {
    text-decoration: underline;
}

.download-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.file-size {
    color: #888;
    font-size: 13px;
    margin-left: 10px;
    flex-shrink: 0;
}

.no-files {
    color: #888;
    font-style: italic;
}

.error {
    color: #ff6b6b;
    padding: 20px;
    background: #2a2a2a;
    border-radius: 8px;
    text-align: center;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .gallery-detail-layout {
        flex-direction: column;
    }
    
    .gallery-cover {
        flex: 1;
        max-width: 100%;
    }
    
    .cover-image {
        max-width: 400px;
        margin: 0 auto;
        display: block;
    }
}

@media (min-width: 1920px) {
    .gallery-cover {
        flex: 0 0 450px;
        max-width: 450px;
    }
    
    .metadata-title {
        font-size: 28px;
    }
}

@media (min-width: 3840px) {
    .gallery-cover {
        flex: 0 0 600px;
        max-width: 600px;
    }
    
    .metadata-title {
        font-size: 32px;
    }
    
    .metadata-row {
        font-size: 18px;
    }
    
.tag {
    font-size: 15px;
    padding: 6px 14px;
}
}

/* 阅读器（Swiper + Zoom） */
body.reader-open {
    overflow: hidden;
}

#readerOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    z-index: 9999;
    display: none;
}

#readerOverlay.show {
    display: block;
}

.reader-modal {
    position: absolute;
    inset: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1;
}

.reader-backdrop {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.reader-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    z-index: 2;
    user-select: none;
}

.reader-prev {
    left: 16px;
}

.reader-next {
    right: 16px;
}

.reader-nav:hover {
    background: rgba(255, 255, 255, 0.12);
}

.reader-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: 1px solid #444;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 20px;
    cursor: pointer;
    z-index: 2;
}

.reader-close:hover {
    background: rgba(255, 255, 255, 0.12);
}

.reader-swiper {
    flex: 1;
    min-height: 200px;
    width: 100%;
    height: 100%;
}

.reader-swiper .swiper-slide {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #000;
    height: 100%;
}

.reader-swiper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.reader-swiper .swiper-zoom-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reader-hint {
    text-align: center;
    color: #c5c5c5;
    font-size: 12px;
    letter-spacing: 0.5px;
}
