/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* 首页标题栏样式 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 50px;
    background-color: #4a6bff;
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo {
    height: 40px;
    margin-right: 15px;
    border-radius: 10px;
}

.logo-container h1 {
    font-size: 24px;
    font-weight: 600;
}

.date-container {
    font-size: 16px;
}

/* Banner样式 */
.banner {
    width: 100%;
    height: 200px;
    overflow: hidden;
    margin-bottom: 30px;
}

.banner-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 倒计时入口样式 */
.countdown-entries {
    padding: 20px 50px;
    background-color: #fff;
    margin-bottom: 30px;
}

.entry-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-gap: 20px;
}

.entry-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
    cursor: pointer;
}

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

.entry-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.entry-title {
    padding: 15px;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
}

.entry-ended {
    position: relative;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 180px;
    background-color: rgba(0, 0, 0, 0.5);
}

.ended-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #ff4d4f;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

/* 备案及联系方式样式 */
.footer {
    text-align: center;
    padding: 20px;
    font-size: 12px;
    color: #777;
    position: static;
    bottom: 0px; /* 固定在页面底部 */
    left: 0;
    width: 100%;
    z-index: 50; /* 确保备案信息在广告弹窗下方 */
}

.beian a {
    color: #777;
    text-decoration: none;
}

.beian a:hover {
    text-decoration: underline;
}

.beian img {
    height: 20px;
    width: auto; 
    vertical-align: middle;
}

.contact {
    margin-top: 10px;
}

/* 活动弹窗样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

/* 首页广告弹窗隐藏 */
.activity-modal {
    display: none !important;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    position: relative;
}

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

.modal-title {
    margin-bottom: 20px;
    font-size: 24px;
    color: #333;
}

.modal-body {
    text-align: center;
}

.btn-primary {
    background-color: #4a6bff;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 20px;
}

/* 倒计时页面样式 */
.countdown-page {
    background-image: url('../images/bg1.jpg');
    background-size: cover;
    background-position: center;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 50px 20px;
}

.countdown-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: -1;
    transition: background-image 0.5s;
}

.exam-title {
    font-size: 36px;
    margin-bottom: 10px;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    text-align: center; /* 标题居中 */
}

.exam-time-container {
    margin-bottom: 40px;
    text-align: center; /* 时间居中 */
}

.exam-time {
    font-size: 18px;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.countdown-display {
    display: flex;
    justify-content: center;
    margin-bottom: 50px;
}

.countdown-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 10px;
}

.countdown-value {
    font-size: 80px;
    font-weight: bold;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    background-color: rgba(0, 0, 0, 0.3);
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.countdown-label {
    margin-top: 10px;
    font-size: 24px;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* 设置弹窗样式 */
.settings-entry {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 15px;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    display: none;
}

.icon-settings {
    font-size: 24px;
}

.settings-modal {
    display: flex;
}

.settings-content {
    width: 500px; /* 增加宽度 */
    max-width: 90%; /* 确保在小屏幕上自适应 */
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

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

/* 设置弹窗标题居中 */
.settings-body {
    padding: 20px;
    text-align: center;
}

.background-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.bg-option {
    width: 48%; /* 每行显示 2 张缩略图 */
    height: 80px;
    object-fit: cover;
    border: 3px solid transparent;
    border-radius: 5px;
    cursor: pointer;
    transition: border-color 0.3s;
    margin-bottom: 10px;
}

.bg-option.active {
    border-color: #4a6bff;
}

/* 广告位样式 */
.ad-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 728px; /* 常见的广告宽度 */
    max-width: 100%; /* 确保在小屏幕上自适应 */
    height: 90px; /* 常见的广告高度 */
    z-index: 100;
    display: none;
}

.ad-content {
    width: 100%;
    height: 100%;
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

.ad-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: transparent;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .entry-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .header {
        padding: 15px 20px;
        flex-direction: column;
    }
    
    .logo-container {
        margin-bottom: 10px;
    }
    
    .entry-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .countdown-value {
        font-size: 60px;
        width: 100px;
        height: 100px;
    }
    
    .countdown-label {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .entry-grid {
        grid-template-columns: 1fr;
    }
    
    .countdown-value {
        font-size: 40px;
        width: 80px;
        height: 80px;
    }
    
    .countdown-label {
        font-size: 16px;
    }
    
    .exam-title {
        font-size: 28px;
    }
}

/* 倒计时页的备案样式 */
.countdown-page .footer {
    text-align: center;
    padding: 20px;
    font-size: 12px;
    color: #777;
    position: absolute; /* 倒计时页的备案信息位于页面底部 */
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 50; /* 确保备案信息在广告弹窗下方 */
}