.competitions-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
}

.page-hero {
    margin-bottom: 32px;
}

.page-hero h1 {
    font-size: 28px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.competition-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    padding: 20px 24px;
    background: #fff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 12px;
    margin-bottom: 28px;
}

.competition-filter-bar > * {
    margin-right: 12px;
    margin-bottom: 12px;
}

.competition-filter-bar > *:last-child {
    margin-right: 0;
}

.filter-search {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.filter-search svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
}

.filter-search input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    background: #f9fafb;
    color: #111827;
    transition: border-color .15s, box-shadow .15s;
}

.filter-search input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .1);
    background: #fff;
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 120px;
}

.filter-group label {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 5px;
}

.filter-group select {
    padding: 8px 30px 8px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 13px;
    background: #f9fafb;
    color: #111827;
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: border-color .15s;
}

.filter-group select:focus {
    border-color: #6366f1;
}

.filter-reset {
    display: flex;
    align-items: center;
    padding: 8px 14px;
    background: transparent;
    color: #6b7280;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s, color .15s;
    white-space: nowrap;
}

.filter-reset svg {
    margin-right: 6px;
    transition: transform .3s;
}

.filter-reset:hover {
    background: #f3f4f6;
    color: #374151;
}

.filter-reset:hover svg {
    transform: rotate(-180deg);
}

/* 网格：桌面4列 */
.competition-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr) !important;
    grid-gap: 14px;
    margin-bottom: 28px;
}

/* 卡片 */
.competition-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color .2s, box-shadow .2s;
}

.competition-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .07);
}

.competition-card.is-ended {
    filter: grayscale(.5);
    opacity: .75;
}

/* 封面图 */
.competition-thumbnail {
    position: relative;
    width: 100%;
    padding-bottom: 56%;
    overflow: hidden;
    background: #f3f4f6;
}

.competition-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s cubic-bezier(.4, 0, .2, 1);
}

.competition-card:hover .competition-thumbnail img {
    transform: scale(1.05);
}

.competition-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,.4) 0%, transparent 50%);
    pointer-events: none;
}

.competition-type-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
}

.competition-type-badge .type-label {
    display: inline-block;
    background: rgba(0, 0, 0, .5);
    color: #fff;
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: .3px;
}

/* 内容区 */
.competition-content {
    padding: 12px 14px 14px !important;
    flex: 1;
    display: flex;
    flex-direction: column;
    box-sizing: border-box !important;
}

/* 标题行 */
.competition-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 8px !important;
}

.competition-title {
    font-size: 13px !important;
    font-weight: 700;
    color: #111827;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
    margin-right: 6px !important;
    min-height: auto !important;
}

.competition-title a {
    color: inherit;
    text-decoration: none;
    transition: color .15s;
}

.competition-title a:hover {
    color: #6366f1;
}

/* 倒计时 */
.competition-countdown {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 100px;
    font-size: 11px !important;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    border: none;
    box-shadow: none;
    margin-top: 2px;
}

.competition-countdown .countdown-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
    margin-right: 4px;
}

.countdown-live {
    font-family: monospace;
    letter-spacing: .2px;
    font-size: 11px !important;
}

.status-active {
    color: #059669;
    background: #f0fdf4;
}

.status-ending {
    color: #d97706;
    background: #fffbeb;
}

.status-today,
.status-tomorrow {
    color: #dc2626;
    background: #fef2f2;
}

.status-today .countdown-dot,
.status-tomorrow .countdown-dot {
    animation: blink 1.2s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: .25; }
}

.status-ended {
    color: #9ca3af;
    background: #f3f4f6;
}

/* 主办方 */
.competition-organizer {
    display: flex;
    align-items: center;
    padding-bottom: 8px !important;
    border-bottom: 1px solid #f3f4f6;
    margin-bottom: 8px !important;
}

.competition-organizer .org-label {
    color: #9ca3af;
    flex-shrink: 0;
    font-size: 11px !important;
    margin-right: 4px;
    font-weight: 500;
}

.competition-organizer .org-value {
    color: #6b7280;
    font-weight: 500;
    overflow: hidden;
    font-size: 11px !important;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 奖金 + 截止日期 */
.competition-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-column-gap: 8px;
    grid-row-gap: 6px;
    margin-bottom: 10px !important;
}

.meta-item {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.meta-label {
    font-size: 10px !important;
    color: #9ca3af;
    font-weight: 500;
    margin-bottom: 4px !important;
}

.meta-value {
    font-size: 12px !important;
    font-weight: 700;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.meta-value.prize {
    color: #f59e0b;
}

.meta-value.deadline {
    color: #f97316;
}

/* 按钮 */
.competition-actions {
    display: flex;
    margin-top: auto;
    padding-top: 10px !important;
}

.comp-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 8px !important;
    border-radius: 100px;
    font-size: 12px !important;
    font-weight: 600;
    text-decoration: none;
    border: 1.5px solid;
    transition: background .15s, opacity .15s, color .15s;
    white-space: nowrap;
}

.comp-btn + .comp-btn {
    margin-left: 6px;
}

.comp-btn-outline {
    background: transparent;
    border-color: #e5e7eb;
    color: #374151;
}

.comp-btn-outline:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.comp-btn-fill {
    background: #111827;
    border-color: #111827;
    color: #fff;
}

.comp-btn-fill:hover {
    opacity: .85;
    color: #fff;
}

/* 加载更多 */
.loadmore-wrap {
    text-align: center;
    padding: 20px 0;
}

#comp-loadmore {
    padding: 10px 32px;
    background: transparent;
    color: #374151;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}

#comp-loadmore:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

/* 加载中 */
#competition-loading {
    text-align: center;
    padding: 40px;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top-color: #6366f1;
    border-radius: 50%;
    margin: 0 auto;
    animation: spin .7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 空状态 */
.competition-empty {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
}

.competition-empty svg {
    margin-bottom: 12px;
    opacity: .4;
}

.competition-empty p {
    font-size: 15px;
    margin: 0;
}

/* 响应式 */
@media (max-width: 1200px) {
    .competition-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .competitions-page {
        padding: 24px 16px;
    }

    .competition-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        grid-gap: 12px;
    }

    .competition-filter-bar {
        padding: 16px;
    }

    .competition-filter-bar > * {
        margin-right: 0;
        width: 100%;
    }

    .filter-search {
        min-width: 100%;
    }

    .filter-group {
        min-width: 100%;
    }

    .filter-reset {
        width: 100%;
        justify-content: center;
    }

    .competition-content {
        padding: 12px 14px 14px !important;
    }
}

@media (max-width: 480px) {
    .competition-grid {
        grid-template-columns: 1fr !important;
    }

    .competition-actions {
        flex-direction: column;
    }

    .comp-btn + .comp-btn {
        margin-left: 0;
        margin-top: 6px;
    }

    .comp-btn {
        width: 100%;
    }
}