/* RiPro Site Notice Styles */
.alert {
    position: relative;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.25rem;
    display: block !important;
    box-sizing: border-box !important;
    width: 100% !important;
}

/* 匹配"最新推荐"标题区域的宽度和样式 */
.section-notice {
    max-width: 1170px;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 15px;
    padding-right: 15px;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 999 !important;
    box-sizing: border-box !important;
}

/* 确保xueshuziyuan.com上公告显示 */
body #wrapper .textwidget .section-notice,
body #wrapper .textwidget .section-notice .alert,
body .textwidget .section-notice,
body .textwidget .section-notice .alert,
#wrapper .textwidget .section-notice,
#wrapper .textwidget .section-notice .alert,
.textwidget .section-notice,
.textwidget .section-notice .alert,
.textwidget .alert,
.widget .section-notice,
.widget .section-notice .alert {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 999 !important;
}

/* 只有在添加了特定类时才隐藏 */
.textwidget.notice-closed .section-notice {
    display: none !important;
}

/* 确保xueshuziyuan.com站点上alert元素正确显示 */
body.home .textwidget .alert,
body.archive .textwidget .alert,
body.single .textwidget .alert,
#wrapper .textwidget .alert,
.site-content .textwidget .alert,
.main-content .textwidget .alert,
.container .textwidget .alert {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 999 !important;
}

.text-center {
    text-align: center !important;
}

.mb-4 {
    margin-bottom: 1.5rem !important;
}

.alert-primary {
    color: #004085 !important;
    background-color: #cce5ff !important;
    border-color: #b8daff !important;
}

.alert-secondary {
    color: #383d41 !important;
    background-color: #e2e3e5 !important;
    border-color: #d6d8db !important;
}

.alert-success {
    color: #155724 !important;
    background-color: #d4edda !important;
    border-color: #c3e6cb !important;
}

.alert-danger {
    color: #721c24 !important;
    background-color: #f8d7da !important;
    border-color: #f5c6cb !important;
}

.alert-warning {
    color: #856404 !important;
    background-color: #fff3cd !important;
    border-color: #ffeeba !important;
}

.alert-info {
    color: #0c5460 !important;
    background-color: #d1ecf1 !important;
    border-color: #bee5eb !important;
}

.alert-light {
    color: #818182 !important;
    background-color: #fefefe !important;
    border-color: #fdfdfe !important;
}

.alert-dark {
    color: #1b1e21 !important;
    background-color: #d6d8d9 !important;
    border-color: #c6c8ca !important;
}

.alert-dismissible {
    padding-right: 4rem !important;
    padding-bottom: 35px !important;
}

.alert-dismissible .close {
    position: absolute !important;
    top: auto !important;
    bottom: 5px !important;
    right: 5px !important;
    padding: 0.75rem 1.25rem !important;
    color: inherit !important;
    z-index: 10000 !important;
    cursor: pointer !important;
    pointer-events: auto !important;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.close {
    float: right !important;
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    color: #000 !important;
    text-shadow: 0 1px 0 #fff !important;
    opacity: 0.5 !important;
    background: transparent !important;
    border: 0 !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    padding: 0 !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    z-index: 10000 !important;
}

.close:hover {
    color: #000 !important;
    text-decoration: none !important;
    opacity: 0.75 !important;
    cursor: pointer !important;
}

.close:focus {
    outline: none !important;
}

.close:not(:disabled):not(.disabled):focus, 
.close:not(:disabled):not(.disabled):hover {
    opacity: 0.75 !important;
    cursor: pointer !important;
}

button.close {
    padding: 0 !important;
    background-color: transparent !important;
    border: 0 !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    cursor: pointer !important;
}

.fade {
    transition: opacity .15s linear !important;
}

.fade.show {
    opacity: 1 !important;
}

/* 确保spinner-grow正常显示 */
.spinner-grow {
    display: inline-block !important;
    width: 2rem !important;
    height: 2rem !important;
    vertical-align: text-bottom !important;
    background-color: currentColor !important;
    border-radius: 50% !important;
    animation: spinner-grow .75s linear infinite !important;
    opacity: 1 !important;
    visibility: visible !important;
    position: relative !important;
    z-index: 1000 !important;
}

.spinner-grow-sm {
    width: 0.5rem !important;
    height: 0.5rem !important;
    display: inline-block !important;
    opacity: 1 !important;
}

/* 强制定义动画 */
@keyframes spinner-grow {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0);
    }
}

/* 确保闪烁圆点在Hi,重要公告后面正确显示 */
.alert span .spinner-grow-sm {
    margin-left: 0.25rem !important;
    vertical-align: middle !important;
    display: inline-block !important;
    opacity: 1 !important;
}

.ml-1 {
    margin-left: 0.25rem !important;
}

.small {
    font-size: 80% !important;
    font-weight: 400 !important;
}

/* Badge Styles */
.badge9 {
    display: inline-block !important;
    padding: 0.25em 0.4em !important;
    font-size: 75% !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    text-align: center !important;
    white-space: nowrap !important;
    vertical-align: baseline !important;
    border-radius: 0.25rem !important;
    transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out !important;
    color: #fff !important;
    text-decoration: none !important;
}

.badge9:hover {
    text-decoration: none !important;
    color: #fff !important;
}

.badge9-primary {
    color: #fff !important;
    background-color: #007bff !important;
}

.badge9-primary:hover {
    background-color: #0069d9 !important;
}

.mr-2 {
    margin-right: 0.5rem !important;
}

/* 针对xueshuziyuan.com网站的特殊修复 */
body.home .textwidget .section-notice .alert .close,
body.archive .textwidget .section-notice .alert .close,
body.single .textwidget .section-notice .alert .close,
body .textwidget .section-notice .alert .close,
#wrapper .textwidget .section-notice .alert .close,
.section-notice .alert .close {
    position: absolute !important;
    right: 10px !important;
    top: auto !important;
    bottom: 10px !important;
    opacity: 0.7 !important;
    cursor: pointer !important;
    z-index: 10000 !important;
    background: none !important;
    border: none !important;
    font-size: 1.5rem !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 30px !important;
    height: 30px !important;
    line-height: 1 !important;
    color: inherit !important;
    text-shadow: 0 1px 0 #fff !important;
    pointer-events: auto !important;
    display: block !important;
}

body.home .textwidget .section-notice .alert .close:hover,
body.archive .textwidget .section-notice .alert .close:hover,
body.single .textwidget .section-notice .alert .close:hover,
body .textwidget .section-notice .alert .close:hover,
#wrapper .textwidget .section-notice .alert .close:hover,
.section-notice .alert .close:hover {
    opacity: 1 !important;
    cursor: pointer !important;
}

/* 强制修复特定网站的样式冲突 */
.homepage-notice-close,
button.homepage-notice-close,
.alert .close,
button.close {
    position: absolute !important;
    bottom: 5px !important;
    right: 5px !important;
    top: auto !important;
    z-index: 10000 !important;
    width: 30px !important;
    height: 30px !important;
    opacity: 0.7 !important;
    cursor: pointer !important;
    background: transparent !important;
    border: none !important;
}

/* 确保关闭按钮在各种主题下都可见 */
.alert-dismissible .close span,
.alert .close span,
.homepage-notice-close span {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    display: inline-block !important;
    cursor: pointer !important;
    pointer-events: auto !important;
}

/* 修复xueshuziyuan.com网站上的可能冲突 */
#wrapper .textwidget .section-notice,
.site-content .textwidget .section-notice,
.container .textwidget .section-notice,
.main-content .textwidget .section-notice {
    display: block !important;
    visibility: visible !important;
    margin-top: 15px !important;
    margin-bottom: 15px !important;
}

/* 给关闭按钮添加明显的视觉提示 */
.alert .close:before {
    content: "" !important;
    display: block !important;
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    width: 30px !important;
    height: 30px !important;
    background-color: rgba(0,0,0,0.1) !important;
    border-radius: 0 3px 0 3px !important;
    z-index: -1 !important;
}

/* 确保在xueshuziyuan.com网站上显示正确 */
.site-content .textwidget,
#main .textwidget,
#content .textwidget,
#wrapper .textwidget {
    overflow: visible !important;
}

/* 针对xueshuziyuan.com网站的特殊优化 */
@media screen and (max-width: 768px) {
    .section-notice {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
}

/* 添加打开/关闭按钮的样式 */
.notice-toggle-container {
    margin: 5px 0 !important;
    text-align: center !important;
}

.notice-toggle-btn {
    display: inline-block !important;
    padding: 3px 10px !important;
    background-color: #5a5757 !important; /* 首页的公告颜色 */
    color: white !important;
    border: none !important;
    border-radius: 3px !important;
    cursor: pointer !important;
    font-size: 12px !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
    margin: 5px 0 !important;
}

.notice-toggle-btn:hover {
    opacity: 0.8 !important;
    text-decoration: none !important;
}

.notice-toggle-btn:focus {
    outline: none !important;
    box-shadow: 0 0 0 2px rgba(249, 15, 18, 0.3) !important;
}

/* 确保切换动画顺畅 */
.notice-content {
    overflow: hidden !important;
    transition: height 0.3s ease !important;
}

/* 添加可见性标记 */
.notice-content.visible {
    display: block !important;
}

.notice-content.hidden {
    display: none !important;
}

/* 支持点击外部关闭 */
.notice-backdrop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.3) !important;
    z-index: 9998 !important;
    display: none !important;
}

.notice-backdrop.active {
    display: block !important;
}

/* 适配移动设备 */
@media (max-width: 768px) {
    .notice-toggle-btn {
        width: 80% !important;
        max-width: 200px !important;
        padding: 5px 10px !important;
        font-size: 14px !important;
    }
}

/* 强制公告显示 */
.widget_ripro_site_notice .textwidget,
.textwidget:not(.notice-closed),
.textwidget.notice-closed {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* 确保section-notice始终显示 */
.textwidget .section-notice,
.textwidget.notice-closed .section-notice {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    max-height: none !important;
    overflow: visible !important;
    margin-bottom: 20px !important;
    padding: 0 !important;
}

/* 确保alert元素显示 */
.section-notice .alert,
.textwidget.notice-closed .section-notice .alert {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin-bottom: 0 !important;
}

/* 确保关闭按钮正确显示和运作 */
.section-notice .alert .close,
.homepage-notice-close {
    position: absolute;
    top: 0;
    right: 0;
    padding: 0.75rem 1.25rem;
    color: inherit;
    cursor: pointer !important;
    pointer-events: auto !important;
    z-index: 100;
}

/* 确保关闭按钮悬停样式正确 */
.section-notice .alert .close:hover,
.homepage-notice-close:hover {
    opacity: 0.75 !important;
}

/* 增强浮动按钮可见性 */
#floating-notice-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    text-align: center;
    line-height: 50px;
    cursor: pointer;
    z-index: 9999;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    display: none;
}

#floating-notice-toggle.visible {
    display: block;
    animation: pulse 2s infinite;
}

/* 在移动设备上隐藏浮动按钮 */
@media (max-width: 768px) {
    #floating-notice-toggle {
        display: none !important;
    }
    #floating-notice-toggle.visible {
        display: none !important;
        animation: none !important;
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 5px 15px rgba(0,0,0,0.4);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    }
}

/* 超强化关闭按钮样式，确保优先级最高 */
body .homepage-notice-close,
body .alert .close,
body button.close,
body .alert-dismissible .close,
html body .alert .close,
html body button.close,
.homepage-notice-close,
.alert .close,
button.close,
.alert-dismissible .close {
    position: absolute !important;
    bottom: 5px !important;
    right: 5px !important;
    top: auto !important;
    z-index: 10000 !important;
    display: block !important;
    width: 30px !important;
    height: 30px !important;
    line-height: 30px !important;
    text-align: center !important;
    cursor: pointer !important;
    opacity: 0.7 !important;
    text-decoration: none !important;
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: inherit !important;
    text-shadow: 0 1px 0 #fff !important;
    background: transparent !important;
    border: none !important;
}

body .homepage-notice-close:hover,
body .alert .close:hover,
body button.close:hover,
body .alert-dismissible .close:hover,
html body .alert .close:hover,
html body button.close:hover,
.homepage-notice-close:hover,
.alert .close:hover,
button.close:hover,
.alert-dismissible .close:hover {
    opacity: 1 !important;
    color: #ff0000 !important;
    background-color: rgba(255, 255, 255, 0.4) !important;
    text-decoration: none !important;
    cursor: pointer !important;
}

/* 超强化收起/显示公告按钮样式 */
body .notice-toggle-btn,
html body .notice-toggle-btn,
.notice-toggle-btn {
    cursor: pointer !important;
    padding: 5px 15px !important;
    border-radius: 3px !important;
    color: white !important;
    font-size: 14px !important;
    font-weight: bold !important;
    transition: all 0.3s ease !important;
    display: inline-block !important;
    margin: 10px auto !important;
    text-align: center !important;
    border: none !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2) !important;
    text-decoration: none !important;
    line-height: 1.5 !important;
    min-width: 100px !important;
    max-width: 200px !important;
    position: relative !important;
    overflow: visible !important;
    z-index: 9999 !important;
    height: auto !important;
    min-height: 30px !important;
}

.notice-toggle-btn:hover {
    opacity: 0.9 !important;
    box-shadow: 0 3px 8px rgba(0,0,0,0.3) !important;
}

.notice-toggle-btn:active {
    transform: translateY(1px) !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2) !important;
}

.notice-toggle-container {
    text-align: center !important;
    margin: 10px 0 !important;
}

/* 增强圆点闪烁效果 */
@keyframes spinner-grow-enhanced {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(0);
        opacity: 0;
    }
}

.spinner-grow {
    animation: spinner-grow-enhanced 0.75s linear infinite !important;
    display: inline-block !important;
    width: 0.5rem !important;
    height: 0.5rem !important;
    vertical-align: middle !important;
    background-color: currentColor !important;
    border-radius: 50% !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 9999 !important;
}

.spinner-grow-sm {
    width: 0.5rem !important;
    height: 0.5rem !important;
    margin-left: 3px !important;
} 