#search-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

#search-modal .modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #f9fbfc 0%, #ffffff 100%);
    width: 80%;
    max-width: 650px;
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(50, 50, 93, 0.1), 0 5px 15px rgba(0, 0, 0, 0.07);
    animation: slideIn 0.3s ease-in-out;
    overflow: hidden;
}

@keyframes slideIn {
    from {
        top: 45%;
        opacity: 0;
    }

    to {
        top: 50%;
        opacity: 1;
    }
}

#search-modal .search-box {
    width: 100%;
    padding: 16px 20px;
    font-size: 18px;
    border: 2px solid #e0e6ed;
    border-radius: 8px;
    outline: none;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
    color: #32325d;
}

#search-modal .search-box:focus {
    border-color: #6772e5;
    box-shadow: 0 4px 6px rgba(50, 50, 93, 0.11), 0 1px 3px rgba(0, 0, 0, 0.08);
    background-color: #ffffff;
}

#search-modal .close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    color: #8898aa;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

#search-modal .close-button:hover {
    color: #32325d;
    background-color: #f0f4f8;
}

#search-results {
    margin-top: 25px;
    max-height: 350px;
    overflow-y: auto;
    border-top: 2px solid #f0f4f8;
    padding-top: 20px;
}

#search-results::-webkit-scrollbar {
    width: 8px;
}

#search-results::-webkit-scrollbar-thumb {
    background-color: #d1dce8;
    border-radius: 4px;
}

#search-results .result-item {
    padding: 15px 0;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
}

#search-results .result-item:hover {
    background-color: #f6f9fc;
    transform: translateX(5px);
}

#search-results .result-title {
    font-weight: 600;
    color: #32325d;
    font-size: 16px;
    margin-bottom: 6px;
}

#search-results .result-excerpt {
    color: #6b7c93;
    font-size: 14px;
    line-height: 1.5;
}

#search-results .result-item:empty {
    text-align: center;
    padding: 40px 0;
    color: #8898aa;
}

/* Sidebar Sticky States */
.sidebar-is-fixed {
    position: fixed !important;
    z-index: 10 !important;
    top: 80px !important; /* Corresponds to top-20 in Tailwind */
}

.sidebar-is-at-bottom {
    position: absolute !important;
    bottom: 0 !important;
    top: auto !important;
    left: 0 !important;
    right: 0 !important;
}

/* 小工具管理样式 */
.widget-item {
    transition: all 0.2s ease;
}

.widget-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.widget-item .fa-grip-vertical {
    cursor: grab;
}

.widget-item .fa-grip-vertical:active {
    cursor: grabbing;
}

.sortable-ghost {
    opacity: 0.5;
    background: #e5e7eb;
}

.sortable-chosen {
    transform: rotate(2deg);
}

.sortable-drag {
    transform: rotate(5deg);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* 开关样式优化 */
.widget-toggle:checked + div {
    background-color: #3b82f6;
}

.widget-toggle:checked + div:after {
    transform: translateX(100%);
    border-color: white;
}

.widget-toggle + div:after {
    transition: all 0.3s ease;
}

/* 头条资讯图片蒙版样式 */
.article-gradient {
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.1) 20%,
        rgba(0, 0, 0, 0.3) 40%,
        rgba(0, 0, 0, 0.5) 60%,
        rgba(0, 0, 0, 0.7) 80%,
        rgba(0, 0, 0, 0.85) 100%
    ) !important;
}

/* 增强版蒙版 - 更强的对比度 */
.article-gradient-strong {
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.2) 30%,
        rgba(0, 0, 0, 0.6) 70%,
        rgba(0, 0, 0, 0.9) 100%
    ) !important;
}

/* 彩色蒙版 - 主题色渐变 */
.article-gradient-colored {
    background: linear-gradient(
        to bottom,
        rgba(59, 130, 246, 0) 0%,
        rgba(59, 130, 246, 0.1) 30%,
        rgba(59, 130, 246, 0.3) 60%,
        rgba(0, 0, 0, 0.7) 100%
    ) !important;
}

/* 侧边蒙版 - 从左到右 */
.article-gradient-side {
    background: linear-gradient(
        to right,
        rgba(0, 0, 0, 0.8) 0%,
        rgba(0, 0, 0, 0.4) 40%,
        rgba(0, 0, 0, 0) 100%
    ) !important;
}

/* 中心蒙版 - 四周暗化 */
.article-gradient-center {
    background: radial-gradient(
        ellipse at center,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 0.2) 50%,
        rgba(0, 0, 0, 0.8) 100%
    ) !important;
}

/* 悬停效果增强 */
.group:hover .article-gradient {
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.1) 0%,
        rgba(0, 0, 0, 0.2) 20%,
        rgba(0, 0, 0, 0.4) 40%,
        rgba(0, 0, 0, 0.6) 60%,
        rgba(0, 0, 0, 0.8) 80%,
        rgba(0, 0, 0, 0.95) 100%
    );
    transition: background 0.3s ease;
}

/* 文字阴影增强可读性 */
.article-gradient h1,
.article-gradient h2,
.article-gradient h3,
.article-gradient p,
.article-gradient span {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* 分类标签样式增强 */
.article-gradient .bg-primary\/90,
.article-gradient .bg-secondary\/90 {
    backdrop-filter: blur(4px);
    background-color: rgba(59, 130, 246, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* 自定义透明度支持 */
.article-gradient[style*="--mask-opacity"] {
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, calc(var(--mask-opacity) * 0.1)) 20%,
        rgba(0, 0, 0, calc(var(--mask-opacity) * 0.3)) 40%,
        rgba(0, 0, 0, calc(var(--mask-opacity) * 0.5)) 60%,
        rgba(0, 0, 0, calc(var(--mask-opacity) * 0.7)) 80%,
        rgba(0, 0, 0, var(--mask-opacity)) 100%
    ) !important;
}

.article-gradient-strong[style*="--mask-opacity"] {
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, calc(var(--mask-opacity) * 0.2)) 30%,
        rgba(0, 0, 0, calc(var(--mask-opacity) * 0.6)) 70%,
        rgba(0, 0, 0, var(--mask-opacity)) 100%
    ) !important;
}

.article-gradient-colored[style*="--mask-opacity"] {
    background: linear-gradient(
        to bottom,
        rgba(59, 130, 246, 0) 0%,
        rgba(59, 130, 246, calc(var(--mask-opacity) * 0.1)) 30%,
        rgba(59, 130, 246, calc(var(--mask-opacity) * 0.3)) 60%,
        rgba(0, 0, 0, calc(var(--mask-opacity) * 0.7)) 100%
    ) !important;
}

.article-gradient-side[style*="--mask-opacity"] {
    background: linear-gradient(
        to right,
        rgba(0, 0, 0, calc(var(--mask-opacity) * 0.8)) 0%,
        rgba(0, 0, 0, calc(var(--mask-opacity) * 0.4)) 40%,
        rgba(0, 0, 0, 0) 100%
    ) !important;
}

.article-gradient-center[style*="--mask-opacity"] {
    background: radial-gradient(
        ellipse at center,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, calc(var(--mask-opacity) * 0.2)) 50%,
        rgba(0, 0, 0, calc(var(--mask-opacity) * 0.8)) 100%
    ) !important;
}

/* 禁用文字阴影 */
[data-no-text-shadow="true"] h1,
[data-no-text-shadow="true"] h2,
[data-no-text-shadow="true"] h3,
[data-no-text-shadow="true"] p,
[data-no-text-shadow="true"] span {
    text-shadow: none !important;
}

/* 增强文字对比度（当禁用阴影时） */
[data-no-text-shadow="true"] h1,
[data-no-text-shadow="true"] h2,
[data-no-text-shadow="true"] h3 {
    font-weight: 700;
    color: #ffffff !important;
}

[data-no-text-shadow="true"] p,
[data-no-text-shadow="true"] span {
    color: #f3f4f6 !important;
}

/* 响应式蒙版调整 */
@media (max-width: 768px) {
    .article-gradient {
        background: linear-gradient(
            to bottom,
            rgba(0, 0, 0, 0.1) 0%,
            rgba(0, 0, 0, 0.3) 30%,
            rgba(0, 0, 0, 0.6) 60%,
            rgba(0, 0, 0, 0.9) 100%
        );
    }

    .article-gradient h1,
    .article-gradient h2,
    .article-gradient h3 {
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    }

    /* 移动端自定义透明度调整 */
    .article-gradient[style*="--mask-opacity"] {
        background: linear-gradient(
            to bottom,
            rgba(0, 0, 0, calc(var(--mask-opacity) * 0.1)) 0%,
            rgba(0, 0, 0, calc(var(--mask-opacity) * 0.3)) 30%,
            rgba(0, 0, 0, calc(var(--mask-opacity) * 0.6)) 60%,
            rgba(0, 0, 0, var(--mask-opacity)) 100%
        ) !important;
    }
}
