/* 作品展示页面样式 */
/* 背景样式已抽取到 common-background.css */
body.works-body {
    /* 背景由 common-bg-body 类提供 */
}

/* 页面容器 */
.works-page {
    min-height: calc(100vh - 60px);
    padding: 150px 15px 60px;
}

.works-page .container {
    max-width: 1200px;
}

/* 标题区域 */
.works-header {
    text-align: center;
    margin-bottom: 60px;
    width: 100%;
}

.works-title-wrapper {
    position: relative;
    margin-bottom: 20px;
}

/* 完整的装饰线图片 */
.title-divider-full {
    width: 100%;
    height: auto;
    display: block;
}

.works-title {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 28px;
    font-weight: bold;
    color: #333;
    margin: 0;
    font-family: "SimHei", "Microsoft YaHei", sans-serif;
    letter-spacing: 3px;
    white-space: nowrap;
    padding: 5px 20px;
}

.works-subtitle {
    font-size: 15px;
    color: #d4a958;
    letter-spacing: 1.5px;
    margin: 0;
    font-weight: normal;
    text-align: left;
}

/* Tab切换区域 */
.works-tabs-container {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

.works-tabs {
    display: inline-flex;
    gap: 20px;
}

.works-tab-btn {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.works-tab-btn .tab-bg {
    height: 80px;
    width: auto;
    display: block;
}

.works-tab-btn:hover {
    transform: translateY(-3px);
}

/* Tab按钮内容叠加 */
.works-tab-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: none;
    white-space: nowrap;
}

.works-tab-btn.active .works-tab-content {
    color: #333;
}

.works-tab-btn:not(.active) .works-tab-content {
    color: #D4A574;
}

.works-tab-content .tab-icon {
    height: 18px;
    width: auto;
}

.works-tab-content span {
    font-size: 16px;
    font-weight: bold;
}

/* 搜索区域 */
.works-search-section {
    background: #FFF9E6;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 40px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.works-search-title {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.search-form-row {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 20px;
}

.search-field {
    flex: 1;
}

.search-field label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

.search-field select,
.search-field input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #E5D4A3;
    border-radius: 8px;
    font-size: 14px;
    background: #FFF;
    transition: all 0.3s ease;
}

.search-field select:focus,
.search-field input:focus {
    outline: none;
    border-color: #D4A574;
    box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.1);
}

.search-btn {
    background: linear-gradient(135deg, #F5E6C8 0%, #E5D4A3 100%);
    border: 1px solid #D4A574;
    border-radius: 8px;
    padding: 10px 40px;
    font-size: 16px;
    font-weight: bold;
    color: #8B4513;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.search-btn:hover {
    background: linear-gradient(135deg, #E5D4A3 0%, #D4A574 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(212, 165, 116, 0.3);
}

/* 作品网格 */
.works-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 30px;
}

.work-card {
    background: #FFFEF9;
    border: 2px solid #E5D4A3;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.work-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    border-color: #D4A574;
}

.work-thumbnail {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background: #F5F5F5;
}

.work-thumbnail-placeholder {
    width: 100%;
    height: 220px;
    background: linear-gradient(135deg, #FFF8DC 0%, #FFEABD 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: #D4A574;
}

.work-info {
    padding: 20px;
}

.work-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin: 0 0 8px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.work-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.work-id {
    font-size: 14px;
    color: #666;
    background: #FFF9E6;
    padding: 4px 12px;
    border-radius: 6px;
    border: 1px solid #E5D4A3;
}

.work-author {
    font-size: 14px;
    color: #666;
}

.work-votes {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
    color: #D4A574;
    font-weight: bold;
}

.work-votes i {
    color: #D4A574;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    background: #FFF9E6;
    border-radius: 12px;
    margin-top: 30px;
}

.empty-state-icon {
    width: 100px;
    height: auto;
    margin: 0 auto 20px;
    opacity: 0.6;
}

.empty-state h3 {
    font-size: 20px;
    color: #666;
    margin: 0 0 10px 0;
}

.empty-state p {
    font-size: 14px;
    color: #999;
    margin: 0;
}

/* 响应式设计 */
@media (max-width: 991px) {
    .works-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .search-form-row {
        flex-wrap: wrap;
    }

    .search-field {
        flex: 1 1 calc(50% - 10px);
    }

    .search-btn {
        flex: 1 1 100%;
    }
}

@media (max-width: 768px) {
    .works-page {
        padding: 20px 0 30px !important;
    }
    
    .works-page .container {
        padding-left: 0 !important;
        padding-right: 0 !important;
        max-width: 100%;
    }

    .works-header {
        margin-bottom: 20px !important;
        padding: 0 15px;
    }

    .works-title-wrapper {
        margin-bottom: 0 !important;
    }

    .title-divider-full {
        display: none !important;
    }

    .works-title {
        position: static !important;
        transform: none !important;
        font-size: 28px !important;
        padding: 0 !important;
        margin: 0 0 10px 0 !important; /* 统一标题和描述间距为10px */
        line-height: 1.2;
    }

    .works-subtitle {
        font-size: 13px !important;
        margin-top: 0 !important; /* 确保间距由标题控制 */
        text-align: center !important;
    }

    .works-tabs-container {
        padding: 0;
        margin-bottom: 20px;
        width: 100%;
    }

    .works-tabs {
        gap: 0;
        display: flex;
        width: 100%;
    }

    .works-tab-btn {
        flex: 1;
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
        margin: 0 !important;
        padding: 10px 8px !important; /* 减小padding从15px到10px */
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .works-tab-btn img {
        max-width: 100%;
        width: 100%;
        height: auto;
        max-height: 40px; /* 减小高度从50px到40px */
        object-fit: contain;
    }
    
    /* Tab内容文字也缩小 */
    .works-tab-content span {
        font-size: 14px !important; /* 减小字体 */
    }
    
    .works-tab-content .tab-icon {
        height: 16px !important; /* 减小图标 */
    }

    .works-search-section {
        padding: 20px 15px;
        border-radius: 0 !important;
        border-left: none;
        border-right: none;
        margin-bottom: 15px;
    }

    .search-form-row {
        flex-wrap: wrap;
        gap: 10px; /* 减小间距 */
    }

    /* 排序方式独占一行 */
    .search-field:first-child {
        flex: 1 1 100%;
    }

    /* 作品编号和参赛者昵称各占一半 */
    .search-field:nth-child(2),
    .search-field:nth-child(3) {
        flex: 1 1 calc(50% - 5px);
        min-width: 0; /* 防止溢出 */
    }

    /* 搜索按钮独占一行 */
    .search-btn {
        flex: 1 1 100%;
        margin-top: 5px;
    }

    .search-field label {
        font-size: 12px;
        margin-bottom: 4px;
    }

    .search-field select,
    .search-field input {
        padding: 8px 10px;
        font-size: 13px;
    }

    .work-card {
        border-radius: 0 !important;
        border-left: none;
        border-right: none;
    }

    .works-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 15px;
    }

    .work-meta {
        flex-wrap: wrap;
    }
}
