/* 弹窗和通知相关样式 */

/* 防止弹窗打开时背景滚动 */
body.popup-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* 公告弹窗 */
.announcement-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    overflow-y: auto; /* 允许在必要时滚动 */
    -webkit-overflow-scrolling: touch; /* 提高iOS滚动体验 */
}

.announcement-popup.active {
    opacity: 1;
    visibility: visible;
}

.announcement-popup-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    padding: 30px;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
    max-height: 80vh; /* 限制最大高度为视口高度的80% */
    overflow-y: auto; /* 内容过多时允许滚动 */
}

.announcement-popup.active .announcement-popup-content {
    transform: translateY(0);
}

.announcement-popup-title {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.announcement-popup-text {
    font-size: 16px;
    line-height: 1.6;
    color: #666;
    margin-bottom: 25px;
}

.announcement-popup-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 20px;
}

.announcement-popup-close,
.announcement-popup-close-btn,
.announcement-popup-close-today {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.announcement-popup-close,
.announcement-popup-close-btn {
    background-color: #f0f0f0;
    color: #666;
}

.announcement-popup-close:hover,
.announcement-popup-close-btn:hover {
    background-color: #e0e0e0;
    color: #333;
}

.announcement-popup-close-today {
    background-color: #e74c3c;
    color: #fff;
}

.announcement-popup-close-today:hover {
    background-color: #c0392b;
}

/* 倒计时卡片 */
.next-draw-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.next-draw-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    transform: translateY(-5px);
}

.next-draw-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: center;
}

.next-draw-header h5 {
    margin: 0;
    font-size: 18px;
    color: #2271b1;
    font-weight: 600;
    display: inline-block;
}

.next-draw-period {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin-bottom: 10px;
    background: #f7f7f7;
    padding: 8px 15px;
    border-radius: 20px;
    display: inline-block;
}

/* 翻页时钟 */
.countdown-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin: 20px 0;
    gap: 10px;
}

.countdown-label {
    font-size: 14px;
    color: #666;
    text-align: center;
    width: 100%;
    margin-bottom: 10px;
}

.countdown-timer {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.flip-clock-wrapper {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin: 0 auto;
    text-align: center;
}

.flip-unit-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 5px;
}

.flip-unit-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    margin-top: 5px;
}

.flip-card {
    position: relative;
    width: 50px;
    height: 70px;
    perspective: 400px;
    margin: 0 2px;
}

.flip-card .top,
.flip-card .bottom,
.flip-card .flip-front,
.flip-card .flip-back {
    position: absolute;
    height: 50%;
    width: 100%;
    left: 0;
    overflow: hidden;
    backface-visibility: hidden;
}

.flip-card .top {
    top: 0;
    border-radius: 6px 6px 0 0;
}

.flip-card .bottom {
    top: 50%;
    border-radius: 0 0 6px 6px;
}

.flip-card .flipper {
    position: absolute;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.5s ease-in-out;
    transform-origin: center 35px;
}

.flip-card .flip-front,
.flip-card .flip-back {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #333;
    color: #fff;
    font-size: 24px;
    font-weight: bold;
}

.flip-card .flip-front {
    transform: rotateX(0deg);
}

.flip-card .flip-back {
    transform: rotateX(-180deg);
}

.flip-card span {
    position: absolute;
    left: 0;
    right: 0;
    display: block;
    height: 100%;
    text-align: center;
    line-height: 70px;
    font-size: 28px;
}

/* 倒计时卡片颜色变化 */
.days-card,
.days-card .top,
.days-card .bottom,
.days-card .flip-front,
.days-card .flip-back {
    background-color: #3498db;
}

.days-card .flip-front {
    background-color: #2980b9;
}

.days-card .flip-back {
    background-color: #3498db;
}

.hours-card,
.hours-card .top,
.hours-card .bottom,
.hours-card .flip-front,
.hours-card .flip-back {
    background-color: #e74c3c;
}

.hours-card .flip-front {
    background-color: #c0392b;
}

.hours-card .flip-back {
    background-color: #e74c3c;
}

.minutes-card,
.minutes-card .top,
.minutes-card .bottom,
.minutes-card .flip-front,
.minutes-card .flip-back {
    background-color: #2ecc71;
}

.minutes-card .flip-front {
    background-color: #27ae60;
}

.minutes-card .flip-back {
    background-color: #2ecc71;
}

.seconds-card,
.seconds-card .top,
.seconds-card .bottom,
.seconds-card .flip-front,
.seconds-card .flip-back {
    background-color: #f39c12;
}

.seconds-card .flip-front {
    background-color: #d35400;
}

.seconds-card .flip-back {
    background-color: #f39c12;
}

.countdown-expired {
    background: #f8d7da;
    color: #721c24;
    padding: 10px 15px;
    border-radius: 6px;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    margin: 15px 0;
}

/* 响应式样式 */
@media (max-width: 768px) {
    .announcement-popup-content {
        width: 90%;
        padding: 20px;
        max-height: 75vh; /* 移动端稍微减小高度，留出更多空间 */
    }
    
    .announcement-popup-title {
        font-size: 20px;
        margin-bottom: 15px;
        padding-bottom: 10px;
    }
    
    .announcement-popup-text {
        font-size: 15px;
        line-height: 1.5;
        margin-bottom: 20px;
    }
    
    .announcement-popup-buttons {
        flex-wrap: wrap; /* 允许按钮换行 */
        justify-content: center; /* 按钮居中 */
        gap: 10px;
    }
    
    .announcement-popup-close,
    .announcement-popup-close-btn,
    .announcement-popup-close-today {
        padding: 8px 16px;
        font-size: 13px;
        flex: 1; /* 按钮弹性布局，平均分配空间 */
        text-align: center;
        min-width: 100px; /* 确保按钮有足够的点击区域 */
    }
    
    .flip-card {
        width: 40px;
        height: 56px;
    }
    
    .flip-card span {
        font-size: 24px;
        line-height: 56px;
    }
    
    .flip-unit-label {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .announcement-popup-content {
        width: 92%;
        padding: 15px;
        max-height: 70vh; /* 进一步减少占用屏幕的高度 */
        margin: 60px auto 20px; /* 上方留出更多空间，方便查看 */
    }
    
    .announcement-popup-title {
        font-size: 18px;
        margin-bottom: 12px;
        padding-bottom: 8px;
    }
    
    .announcement-popup-text {
        font-size: 14px;
        line-height: 1.4;
        margin-bottom: 15px;
    }
    
    .announcement-popup-buttons {
        flex-direction: column; /* 按钮垂直排列 */
        margin-top: 15px;
        width: 100%;
    }
    
    .announcement-popup-close,
    .announcement-popup-close-btn,
    .announcement-popup-close-today {
        width: 100%;
        padding: 10px 0;
        font-size: 14px;
        margin-bottom: 5px;
    }
    
    /* 移动端上优先显示"今日不再显示"按钮 */
    .announcement-popup-close-today {
        order: -1; /* 调整顺序，使其显示在最上方 */
        margin-bottom: 10px; /* 与其他按钮保持距离 */
    }
    
    .flip-card {
        width: 30px;
        height: 42px;
    }
    
    .flip-card span {
        font-size: 18px;
        line-height: 42px;
    }
    
    .flip-unit-label {
        font-size: 9px;
    }
    
    .flip-clock-wrapper {
        gap: 2px;
    }
} 