/* =========================
   公告弹窗样式
   兼容三种主题和低版本设备
========================= */

/* 公告弹窗遮罩层 */
.announcement-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -moz-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -moz-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    -webkit-transition: opacity 0.3s ease, visibility 0.3s ease;
    -moz-transition: opacity 0.3s ease, visibility 0.3s ease;
    -o-transition: opacity 0.3s ease, visibility 0.3s ease;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    -webkit-overflow-scrolling: touch;
    overflow-y: auto;
}

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

/* 公告弹窗主体 */
.announcement-modal {
    background: #1a1a1a;
    -webkit-border-radius: 16px;
    -moz-border-radius: 16px;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: calc(100vh - 40px);
    height: auto;
    -webkit-box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    -moz-box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    -webkit-animation: announcementModalSlideUp 0.3s ease;
    -moz-animation: announcementModalSlideUp 0.3s ease;
    -o-animation: announcementModalSlideUp 0.3s ease;
    animation: announcementModalSlideUp 0.3s ease;
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    -moz-box-orient: vertical;
    -moz-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    position: relative;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

/* 关闭按钮 */
.announcement-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    color: #999;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    -webkit-transition: color 0.2s ease;
    -moz-transition: color 0.2s ease;
    -o-transition: color 0.2s ease;
    transition: color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    z-index: 1;
    padding: 0;
    margin: 0;
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -moz-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -moz-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
}

.announcement-modal-close:hover {
    color: #FFD700;
}

.announcement-modal-close:active {
    opacity: 0.7;
}

/* 弹窗头部 */
.announcement-modal-header {
    padding: 20px 20px 15px 20px;
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -moz-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    gap: 10px;
    /* 低版本iOS兼容：gap不支持时的负margin */
    margin: -5px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.1);
}

/* 低版本iOS兼容：为子元素添加间距 */
.announcement-modal-header > * {
    margin: 5px;
}

.announcement-icon {
    -webkit-flex-shrink: 0;
    -ms-flex-negative: 0;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -moz-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -moz-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    color: #FFD700;
}

.announcement-modal-title {
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    -moz-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    font-size: 15px;
    font-weight: 600;
    color: #FFD700;
    margin: 0;
    padding: 0;
}

/* 弹窗内容 */
.announcement-modal-body {
    padding: 20px;
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    -moz-box-flex: 1;
    -ms-flex: 1;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-height: calc(100vh - 200px);
}

.announcement-content {
    color: #e0e0e0;
    font-size: 13px;
    line-height: 1.8;
    word-wrap: break-word;
    white-space: pre-wrap;
}

/* 弹窗底部 */
.announcement-modal-footer {
    padding: 15px 20px 20px 20px;
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -moz-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    -moz-box-pack: justify;
    -ms-flex-pack: justify;
    justify-content: space-between;
    gap: 15px;
    /* 低版本iOS兼容：gap不支持时的负margin */
    margin: -7.5px;
    border-top: 1px solid rgba(255, 215, 0, 0.1);
}

/* 低版本iOS兼容：为子元素添加间距 */
.announcement-modal-footer > * {
    margin: 7.5px;
}

/* 不再显示复选框 */
.announcement-checkbox-label {
    display: -webkit-box;
    display: -webkit-flex;
    display: -moz-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -moz-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    gap: 8px;
    /* 低版本iOS兼容：gap不支持时的负margin */
    margin: -4px;
}

/* 低版本iOS兼容：为子元素添加间距 */
.announcement-checkbox-label > * {
    margin: 4px;
}

.announcement-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border: 2px solid rgba(255, 215, 0, 0.5);
    -webkit-border-radius: 4px;
    -moz-border-radius: 4px;
    border-radius: 4px;
    background: transparent;
    position: relative;
    -webkit-transition: all 0.2s ease;
    -moz-transition: all 0.2s ease;
    -o-transition: all 0.2s ease;
    transition: all 0.2s ease;
}

.announcement-checkbox:checked {
    background: #FFD700;
    border-color: #FFD700;
}

.announcement-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    -webkit-transform: translate(-50%, -50%);
    -moz-transform: translate(-50%, -50%);
    -ms-transform: translate(-50%, -50%);
    -o-transform: translate(-50%, -50%);
    transform: translate(-50%, -50%);
    color: #1a1a1a;
    font-size: 12px;
    font-weight: bold;
}

.announcement-checkbox-text {
    font-size: 14px;
    color: #999;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* 确认按钮 */
.announcement-modal-btn {
    padding: 10px 24px;
    background: linear-gradient(135deg, #FFB300 0%, #FFA000 100%);
    color: #1a1a1a;
    border: none;
    -webkit-border-radius: 8px;
    -moz-border-radius: 8px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    -webkit-transition: all 0.2s ease;
    -moz-transition: all 0.2s ease;
    -o-transition: all 0.2s ease;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    -webkit-box-shadow: 0 2px 8px rgba(255, 179, 0, 0.3);
    -moz-box-shadow: 0 2px 8px rgba(255, 179, 0, 0.3);
    box-shadow: 0 2px 8px rgba(255, 179, 0, 0.3);
}

.announcement-modal-btn:hover {
    background: linear-gradient(135deg, #FFC107 0%, #FFB300 100%);
    -webkit-box-shadow: 0 4px 12px rgba(255, 179, 0, 0.5);
    -moz-box-shadow: 0 4px 12px rgba(255, 179, 0, 0.5);
    box-shadow: 0 4px 12px rgba(255, 179, 0, 0.5);
    -webkit-transform: translateY(-1px);
    -moz-transform: translateY(-1px);
    -ms-transform: translateY(-1px);
    -o-transform: translateY(-1px);
    transform: translateY(-1px);
}

.announcement-modal-btn:active {
    -webkit-transform: translateY(0);
    -moz-transform: translateY(0);
    -ms-transform: translateY(0);
    -o-transform: translateY(0);
    transform: translateY(0);
    -webkit-box-shadow: 0 2px 6px rgba(255, 179, 0, 0.3);
    -moz-box-shadow: 0 2px 6px rgba(255, 179, 0, 0.3);
    box-shadow: 0 2px 6px rgba(255, 179, 0, 0.3);
}

/* 动画 */
@-webkit-keyframes announcementModalSlideUp {
    from {
        opacity: 0;
        -webkit-transform: translateY(30px);
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        -webkit-transform: translateY(0);
        transform: translateY(0);
    }
}

@-moz-keyframes announcementModalSlideUp {
    from {
        opacity: 0;
        -moz-transform: translateY(30px);
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        -moz-transform: translateY(0);
        transform: translateY(0);
    }
}

@-o-keyframes announcementModalSlideUp {
    from {
        opacity: 0;
        -o-transform: translateY(30px);
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        -o-transform: translateY(0);
        transform: translateY(0);
    }
}

@keyframes announcementModalSlideUp {
    from {
        opacity: 0;
        -webkit-transform: translateY(30px);
        -moz-transform: translateY(30px);
        -ms-transform: translateY(30px);
        -o-transform: translateY(30px);
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        -webkit-transform: translateY(0);
        -moz-transform: translateY(0);
        -ms-transform: translateY(0);
        -o-transform: translateY(0);
        transform: translateY(0);
    }
}

/* =========================
   白色主题 - 公告弹窗
========================= */
body[data-theme="light"] .announcement-modal-overlay {
    background: rgba(0, 0, 0, 0.5);
}

body[data-theme="light"] .announcement-modal {
    background: #ffffff;
    border-color: rgba(76, 175, 80, 0.2);
}

body[data-theme="light"] .announcement-modal-header {
    border-bottom-color: rgba(76, 175, 80, 0.1);
}

body[data-theme="light"] .announcement-icon,
body[data-theme="light"] .announcement-modal-title {
    color: #4CAF50;
}

body[data-theme="light"] .announcement-content {
    color: #333333;
}

body[data-theme="light"] .announcement-modal-footer {
    border-top-color: rgba(76, 175, 80, 0.1);
}

body[data-theme="light"] .announcement-checkbox {
    border-color: rgba(76, 175, 80, 0.5);
}

body[data-theme="light"] .announcement-checkbox:checked {
    background: #4CAF50;
    border-color: #4CAF50;
}

body[data-theme="light"] .announcement-checkbox:checked::after {
    color: #ffffff;
}

body[data-theme="light"] .announcement-checkbox-text,
body[data-theme="light"] .announcement-modal-close {
    color: #666666;
}

body[data-theme="light"] .announcement-modal-close:hover {
    color: #4CAF50;
}

body[data-theme="light"] .announcement-modal-btn {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: #ffffff;
    -webkit-box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
    -moz-box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

body[data-theme="light"] .announcement-modal-btn:hover {
    background: linear-gradient(135deg, #66BB6A 0%, #4CAF50 100%);
    -webkit-box-shadow: 0 4px 12px rgba(76, 175, 80, 0.5);
    -moz-box-shadow: 0 4px 12px rgba(76, 175, 80, 0.5);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.5);
}

/* =========================
   蓝色主题 - 公告弹窗
========================= */
body[data-theme="blue"] .announcement-modal-overlay {
    background: rgba(10, 22, 40, 0.65);
}

body[data-theme="blue"] .announcement-modal {
    background: #ffffff;
    border-color: rgba(33, 150, 243, 0.2);
}

body[data-theme="blue"] .announcement-modal-header {
    border-bottom-color: rgba(33, 150, 243, 0.1);
}

body[data-theme="blue"] .announcement-icon,
body[data-theme="blue"] .announcement-modal-title {
    color: #2196F3;
}

body[data-theme="blue"] .announcement-content {
    color: #333333;
}

body[data-theme="blue"] .announcement-modal-footer {
    border-top-color: rgba(33, 150, 243, 0.1);
}

body[data-theme="blue"] .announcement-checkbox {
    border-color: rgba(33, 150, 243, 0.5);
}

body[data-theme="blue"] .announcement-checkbox:checked {
    background: #2196F3;
    border-color: #2196F3;
}

body[data-theme="blue"] .announcement-checkbox:checked::after {
    color: #ffffff;
}

body[data-theme="blue"] .announcement-checkbox-text,
body[data-theme="blue"] .announcement-modal-close {
    color: #666666;
}

body[data-theme="blue"] .announcement-modal-close:hover {
    color: #2196F3;
}

body[data-theme="blue"] .announcement-modal-btn {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    color: #ffffff;
    -webkit-box-shadow: 0 2px 8px rgba(25, 118, 210, 0.3);
    -moz-box-shadow: 0 2px 8px rgba(25, 118, 210, 0.3);
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.3);
}

body[data-theme="blue"] .announcement-modal-btn:hover {
    background: linear-gradient(135deg, #2196F3 0%, #1976d2 100%);
    -webkit-box-shadow: 0 4px 12px rgba(25, 118, 210, 0.5);
    -moz-box-shadow: 0 4px 12px rgba(25, 118, 210, 0.5);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.5);
}

/* =========================
   低版本设备兼容性
========================= */
/* iOS 7+ 兼容性 */
@supports (-webkit-overflow-scrolling: touch) {
    .announcement-modal-overlay {
        -webkit-overflow-scrolling: touch;
    }
    
    .announcement-modal-body {
        -webkit-overflow-scrolling: touch;
    }
}

/* Android 4.x 兼容性 */
@media screen and (-webkit-min-device-pixel-ratio: 0) and (min-width: 1px) {
    .announcement-modal {
        -webkit-background-clip: padding-box;
        background-clip: padding-box;
    }
}

/* 小屏幕优化 */
@media (max-width: 480px) {
    .announcement-modal {
        width: 95%;
        max-width: none;
        padding: 0;
    }
    
    .announcement-modal-header {
        padding: 15px 15px 12px 15px;
    }
    
    .announcement-modal-body {
        padding: 15px;
        max-height: calc(100vh - 180px);
    }
    
    .announcement-modal-footer {
        padding: 12px 15px 15px 15px;
        -webkit-box-orient: vertical;
        -webkit-box-direction: normal;
        -webkit-flex-direction: column;
        -moz-box-orient: vertical;
        -moz-box-direction: normal;
        -ms-flex-direction: column;
        flex-direction: column;
        gap: 10px;
        /* 低版本iOS兼容：gap不支持时的负margin */
        margin: -5px;
    }
    
    /* 低版本iOS兼容：为子元素添加间距 */
    .announcement-modal-footer > * {
        margin: 5px;
        width: 100%;
    }
    
    .announcement-modal-btn {
        width: 100%;
    }
}

/* 横屏模式优化 */
@media (orientation: landscape) and (max-height: 500px) {
    .announcement-modal {
        max-height: calc(100vh - 20px);
    }
    
    .announcement-modal-body {
        max-height: calc(100vh - 150px);
        padding: 12px;
    }
}

