/* 公告弹窗样式 - 参考AoPro主题样式 */
.popup-notice-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999999999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    /* 背景模糊效果 */
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* 确保弹窗关闭后不影响页面 */
/* 注意：移除这个规则，因为它会在弹窗显示前就隐藏弹窗 */
/* .popup-notice-overlay:not(.show) {
    pointer-events: none;
    display: none;
} */

.popup-notice-overlay.show {
    opacity: 1;
    animation: fadeInOverlay 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInOverlay {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.popup-notice-container {
    background: #f1f2f6;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-width: 720px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.85) translateY(20px);
    transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    opacity: 0;
}

.popup-notice-overlay.show .popup-notice-container {
    transform: scale(1) translateY(0);
    opacity: 1;
    animation: slideUpFadeIn 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUpFadeIn {
    from {
        transform: scale(0.85) translateY(30px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.popup-notice-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f1f2f6;
}

.popup-notice-header-icon {
    font-size: 20px;
    color: #10b981;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.popup-notice-header-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0;
    flex: 1;
}

.popup-notice-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.popup-notice-close-btn:hover {
    background: #e5e7eb;
    color: #111827;
}

.popup-notice-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    color: #374151;
    line-height: 1.8;
    font-size: 14px;
    background: #f1f2f6;
    word-wrap: break-word; /* 允许长单词换行 */
    word-break: break-all; /* 允许在任意字符间换行 */
    /* 自定义滚动条样式 */
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 #f7fafc;
}

.popup-notice-body::-webkit-scrollbar {
    width: 6px;
}

.popup-notice-body::-webkit-scrollbar-track {
    background: #f7fafc;
    border-radius: 3px;
}

.popup-notice-body::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.popup-notice-body::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* 确保富文本编辑器生成的HTML内容正确显示 */
.popup-notice-body p {
    margin: 0 0 16px 0;
    color: #374151;
    word-wrap: break-word;
    line-height: 1.8;
}

.popup-notice-body p:last-child {
    margin-bottom: 0;
}

/* 支持富文本编辑器的各种格式 */
.popup-notice-body div {
    margin: 0 0 16px 0;
    line-height: 1.8;
}

.popup-notice-body div:last-child {
    margin-bottom: 0;
}

.popup-notice-body br {
    line-height: 1.8;
}

/* 支持文本对齐 */
.popup-notice-body [style*="text-align: left"],
.popup-notice-body [style*="text-align:center"],
.popup-notice-body [style*="text-align: right"],
.popup-notice-body [style*="text-align:justify"] {
    display: block;
}

.popup-notice-body [style*="text-align: left"] {
    text-align: left !important;
}

.popup-notice-body [style*="text-align:center"] {
    text-align: center !important;
}

.popup-notice-body [style*="text-align: right"] {
    text-align: right !important;
}

.popup-notice-body [style*="text-align:justify"] {
    text-align: justify !important;
}

/* 支持颜色 */
.popup-notice-body font {
    display: inline;
}

/* 支持加粗、斜体等 */
.popup-notice-body strong,
.popup-notice-body b {
    font-weight: 600;
}

.popup-notice-body em,
.popup-notice-body i {
    font-style: italic;
}

.popup-notice-body u {
    text-decoration: underline;
}

.popup-notice-body s,
.popup-notice-body strike {
    text-decoration: line-through;
}

/* 支持红色高亮文本 */
.popup-notice-body font[color="#c24f4a"],
.popup-notice-body font[color="#c24f4a"] {
    color: #c24f4a !important;
    font-weight: 500;
}

.popup-notice-body b font[color="#c24f4a"] {
    color: #c24f4a !important;
    font-weight: 700;
    font-size: 1.1em;
}

.popup-notice-body img {
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
    margin: 12px auto !important;
    border-radius: 6px !important;
}

.popup-notice-body img[src=""],
.popup-notice-body img:not([src]) {
    display: none !important;
}

.popup-notice-footer {
    padding: 20px 28px;
    border-top: 1px solid #e8eaed;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #f1f2f6;
}

.popup-notice-close-window-btn,
a.myuki-gcard_btn.btn-close,
a#myuki-gcard_close {
    background: #f1f2f6;
    color: #111827;
    border: 2px solid #111827;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: calc(100% - 48px); /* 宽度接近弹窗宽度，减去左右padding */
    max-width: 100%;
    text-decoration: none;
    display: block;
    text-align: center;
    margin: 0 auto;
}

.popup-notice-close-window-btn:hover,
a.myuki-gcard_btn.btn-close:hover,
a#myuki-gcard_close:hover {
    background: #e5e7eb;
    border-color: #111827;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    color: #111827;
}

.popup-notice-close-window-btn:active,
a.myuki-gcard_btn.btn-close:active,
a#myuki-gcard_close:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    background: #d1d5db;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .popup-notice-container {
        width: 95%;
        max-height: 85vh;
    }

    .popup-notice-header {
        padding: 16px 20px;
    }

    .popup-notice-header-title {
        font-size: 16px;
    }

    .popup-notice-body {
        padding: 20px;
        font-size: 13px;
    }

    .popup-notice-footer {
        padding: 12px 20px;
    }
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    .popup-notice-container {
        background: #1f2937;
        color: #f3f4f6;
    }

    .popup-notice-header {
        background: #111827;
        border-bottom-color: #374151;
    }

    .popup-notice-header-title {
        color: #f3f4f6;
    }

    .popup-notice-close-btn {
        color: #9ca3af;
    }

    .popup-notice-close-btn:hover {
        background: #374151;
        color: #f3f4f6;
    }

    .popup-notice-body {
        color: #d1d5db;
    }

    .popup-notice-footer {
        background: #111827;
        border-top-color: #374151;
    }
}

