/* 基础样式重置 */
* {
    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;
}

/* 用户栏样式 */
.user-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    margin-left: auto;
    margin-right: 20px;
}

.user-popup {
    position: absolute;
    top: 60px;
    right: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    padding: 16px;
    z-index: 1000;
    min-width: 200px;
    border: 1px solid #eee;
}

/* 倒计时入口样式 */
.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;
}

/* 自定义目标操作按钮样式 */
.custom-goal-actions {
    display: none !important;
    position: absolute;
    top: 6px;
    right: 6px;
    gap: 4px;
}

.custom-goal:hover .custom-goal-actions {
    display: flex !important;
}

.edit-icon, .del-icon {
    background: rgba(0,0,0,.5);
    color: #fff;
    border-radius: 3px;
    padding: 2px 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.edit-icon:hover, .del-icon:hover {
    background: rgba(0,0,0,.7);
}

/* 自定义目标页日期时间输入框 */
.date-row input {
    display: block !important;
}

/* 备案及联系方式样式 */
.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;
}

.legal-links-contact {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: #777;
}

.legal-links-contact a {
    color: #777;
    text-decoration: none;
}

.legal-links-contact a:hover {
    text-decoration: underline;
}

.link-separator {
    margin: 0 10px;
    color: #ccc;
}

.contact-text {
    color: #777;
}

.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 5px;
}

.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;
    min-width: 120px; /* 确保最小宽度 */
    padding: 0 10px; /* 添加内边距给数字呼吸空间 */
    text-align: center;
    box-sizing: border-box; /* 确保padding包含在宽度内 */
    /* 添加响应式字体大小 */
    font-size: clamp(40px, 8vw, 80px); /* 根据视口宽度自适应字体大小 */
}

/* 针对天数特别处理 */
.countdown-block.days .countdown-value {
    min-width: 140px; /* 天数框稍微宽一点 */
    width: auto; /* 宽度自适应 */
    padding: 0 15px; /* 更多内边距 */
}

.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: block !important; /* 确保显示 */
    transition: all 0.3s ease;
}

.settings-entry:hover {
  background-color: rgba(255, 255, 255, 0.95);
  transform: translateY(-50%) scale(1.1);
}

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

.settings-modal {
    display: flex;
}

.settings-content {
    width: 90%;
    max-width: 500px;
    max-height: 500px; /* 恰好容纳两行缩略图的高度 */
    display: flex;
    flex-direction: column;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    overflow: hidden; /* 防止内容溢出 */
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0; /* 防止标题栏被压缩 */
}

/* 设置弹窗标题居中 */
.settings-body {
    flex: 1;
    overflow: hidden;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.background-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding-right: 8px; /* 为滚动条留出空间 */
    min-height: min-content; /* 确保网格有最小高度 */
}

.bg-option {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.bg-option.active {
    border-color: #4a6bff;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.bg-option:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* 新增VIP容器和角标样式 */
.bg-option-container {
    position: relative;
    grid-column: span 1;
}

.bg-option-container.vip .bg-option {
    filter: brightness(0.7);
}

/* 新增背景选项容器样式 */
.background-options-container {
    flex: 1;
    overflow-y: auto; /* 确保启用垂直滚动 */
    padding: 15px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.3) transparent;
    min-height: 0; /* 重要：允许容器收缩 */
}

/* 自定义滚动条样式 */
.background-options-container::-webkit-scrollbar {
    width: 6px;
}

.background-options-container::-webkit-scrollbar-track {
    background: transparent;
}

.background-options-container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.background-options-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.5);
}

/* VIP角标样式 */
.vip-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    color: #000;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
    z-index: 2;
}

/* 广告位样式 */
.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);
    }
    
    .background-options {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .settings-content {
        max-height: 450px;
        width: 95%;
        max-width: 450px;
    }

    .countdown-value {
        font-size: clamp(30px, 6vw, 60px); /* 移动端字体更小 */
        width: 100px;
        min-width: 100px;
        height: 100px;

    }
    
    .countdown-block.days .countdown-value {
        min-width: 120px;
        padding: 0 12px;
    }

    .countdown-label {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .entry-grid {
        grid-template-columns: 1fr;
    }
    
    .background-options {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .settings-content {
            max-width: 350px; /* 进一步减小宽度 */
        }

    .countdown-value {
        font-size: clamp(24px, 5vw, 40px);
        width: 80px;
        min-width: 80px;
        height: 80px;
    }
    
    .countdown-block.days .countdown-value {
        min-width: 100px;
        padding: 0 10px;
    }

    .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; /* 确保备案信息在广告弹窗下方 */
}

/* 1. 标题栏日期与头像间距再收紧 */
.header .date-container{margin-right:8px}

/* 2. 用户小弹窗统一圆角阴影 */
#user-popup{border-radius:8px;box-shadow:0 4px 20px rgba(0,0,0,.15);overflow:hidden;background:#fff}

/* 3. 会员页/自定义页统一圆角按钮 */
button{border-radius:6px;transition:.2s}button:hover{transform:translateY(-1px)}

/* 会员购买页面卡片选中样式 - 修复边框显示问题 */
.card.active {
    border-color: #4a6bff !important;
    background: #f6f9ff !important;
    box-shadow: 0 0 0 2px #4a6bff !important;
    border-width: 2px !important;
    border-style: solid !important;
}

.card.year.active {
    border-color: #ff6a00 !important;
    background: #fff9f0 !important;
    box-shadow: 0 0 0 2px #ff6a00 !important;
    border-width: 2px !important;
    border-style: solid !important;
}

/* 确保卡片基础样式 */
.card {
    border: 2px solid #e0e0e0 !important;
    border-radius: 8px !important;
    padding: 16px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    border-style: solid !important;
}

.card:hover {
    border-color: #4a6bff !important;
    transform: translateY(-2px) !important;
}