/**
 * 民主投票页面样式
 */

/* 页面容器 */
.vote-page {
    position: relative;
    width: 375px;
    min-height: 2129px;
    margin: 0 auto;
}

/* 进度卡片和下方元素的过渡动画 */
#progressContainer,
#mailProgressContainer,
#tipSection,
#statusSection {
    transition: top 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.3s ease,
                transform 0.3s ease;
}

/* 进度卡片显示/隐藏动画 */
#progressContainer,
#mailProgressContainer {
    opacity: 1;
}

#progressContainer[style*="display: none"],
#mailProgressContainer[style*="display: none"] {
    opacity: 0;
    pointer-events: none;
}

/* 响应式支持 */
@media (max-width: 374px) {
    .vote-page {
        transform: scale(0.85);
        transform-origin: top center;
    }
}

@media (min-width: 768px) {
    .vote-page {
        box-shadow: 0 0 20px rgba(0,0,0,0.1);
    }
}

/* 红头文件弹窗样式 */
.red-header-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.red-header-dialog {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 340px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

.red-header-content {
    padding: 20px;
}

.red-header-image {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 20px;
}

.red-header-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.red-header-btn {
    flex: 1;
    height: 44px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.red-header-btn-cancel {
    background: #f5f5f5;
    color: #666;
}

.red-header-btn-cancel:hover {
    background: #e0e0e0;
}

.red-header-btn-apply {
    background: #c61f0d;
    color: white;
}

.red-header-btn-apply:hover {
    background: #a81909;
}

.red-header-btn-apply:disabled {
    background: #8f8d8d;
    cursor: not-allowed;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 按钮悬停效果 */
.vote-page button:hover {
    opacity: 0.9;
}

.vote-page button:active {
    opacity: 0.8;
}

/* 滚动条样式 */
.vote-page::-webkit-scrollbar {
    width: 6px;
}

.vote-page::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.vote-page::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.vote-page::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ================================
   自定义弹窗样式
   ================================ */

/* 遮罩层 */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-modal-overlay.show {
    opacity: 1;
}

/* 弹窗容器 */
.custom-modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 320px;
    overflow: hidden;
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.custom-modal-overlay.show .custom-modal {
    transform: scale(1);
}

/* 弹窗头部 */
.custom-modal-header {
    background: linear-gradient(135deg, #c61f0d 0%, #e53935 100%);
    padding: 18px 20px;
    position: relative;
}

.custom-modal-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.5) 50%,
        rgba(255, 255, 255, 0) 100%
    );
}

.custom-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: white;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.custom-modal-title::before {
    content: '📢';
    font-size: 20px;
}

.custom-modal-title.confirm::before {
    content: '❓';
}

/* 弹窗内容 */
.custom-modal-body {
    padding: 24px 20px;
    min-height: 80px;
}

.custom-modal-message {
    font-size: 15px;
    line-height: 1.6;
    color: #333;
    text-align: center;
    margin: 0;
    white-space: pre-line;
}

/* 弹窗底部按钮区 */
.custom-modal-footer {
    padding: 0 20px 20px 20px;
    display: flex;
    gap: 12px;
    justify-content: center;
}

.custom-modal-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-align: center;
    display: block;
}

.custom-modal-btn:active {
    transform: scale(0.95);
}

.custom-modal-btn-confirm {
    background: linear-gradient(135deg, #c61f0d 0%, #e53935 100%);
    color: white;
}

.custom-modal-btn-confirm:hover {
    box-shadow: 0 4px 12px rgba(198, 31, 13, 0.4);
}

.custom-modal-btn-cancel {
    background: #f5f5f5;
    color: #666;
}

.custom-modal-btn-cancel:hover {
    background: #e0e0e0;
}

/* 单按钮模式（alert） */
.custom-modal-footer.single-btn {
    justify-content: center;
}

.custom-modal-footer.single-btn .custom-modal-btn {
    flex: none;
    min-width: 120px;
    text-align: center;
}

/* 动画关键帧 */
@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.8) translateY(-20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* 投票成功弹窗样式 */
.vote-success-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vote-success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    animation: overlayFadeIn 0.3s ease-out forwards;
}

@keyframes overlayFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.vote-success-content {
    animation: modalBounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes modalBounceIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.3);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.05);
    }
    70% {
        transform: translate(-50%, -50%) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* 成功图标旋转动画 */
.success-icon-check {
    animation: checkmarkRotate 0.8s ease-out 0.3s forwards;
    display: inline-block;
}

@keyframes checkmarkRotate {
    0% {
        transform: rotate(-180deg) scale(0);
    }
    80% {
        transform: rotate(10deg) scale(1.1);
    }
    100% {
        transform: rotate(0deg) scale(1);
    }
}

/* 奖励金额闪烁效果 */
.reward-amount {
    animation: rewardPulse 1.5s ease-in-out infinite;
}

@keyframes rewardPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* 弹窗关闭按钮悬停 */
#closeVoteSuccess:hover {
    background: #f5f5f5;
    color: #666;
}

/* 确定按钮悬停 */
#confirmVoteSuccess:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0px 4px 10px rgba(76,175,80,0.4);
}