.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.card-hover {
    transition: all 0.2s ease;
}
.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}
.btn-hover {
    transition: all 0.2s ease;
}
.btn-hover:hover {
    transform: scale(1.02);
}
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5); /* 半透明黑色背景 */
    backdrop-filter: blur(2px); /* 背景模糊效果 */
    padding: 20px 0;
}

/* 基础弹窗容器 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5); /* 半透明黑色背景 */
    backdrop-filter: blur(2px); /* 背景模糊效果 */
    padding: 20px 0;
}

/* 弹窗内容容器 */
.modal-content {
    background-color: #fff;
    dark:bg-gray-800;
    margin: 0 auto;
    padding: 24px;
    border-radius: 12px; /* 圆角优化 */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15); /* 增强阴影 */
    width: 90%;
    max-width: 600px; /* 限制最大宽度 */
    max-height: 80vh; /* 限制最大高度 */
    overflow-y: auto; /* 超出高度滚动 */
    position: relative;
    animation: fadeIn 0.3s ease-out; /* 淡入动画 */
}

/* 夜间模式模态框样式修复 */
.dark .modal-content {
    background-color: #333;
    border-color: #555;
    color: #f0f0f0; /* 夜间模式文字颜色加深 */
}
.dark .modal-content input,
.dark .modal-content select,
.dark .modal-content textarea {
    background-color: #444;
    border-color: #666;
    color: #fff;
}
.dark .tab button {
    color: #ddd;
}
.dark .tab button:hover {
    background-color: #555;
}
.dark .tab button.active {
    background-color: #666;
    color: #fff;
}

/* 全部失效资源弹窗特殊样式 */
#all-invalid-modal .modal-content {
    max-width: 900px; /* 更宽的弹窗 */
}

/* 关闭按钮优化 */
.close, .close-edit, .close-all-invalid {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 22px;
    font-weight: bold;
    color: #888;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%; /* 圆形按钮 */
    transition: all 0.2s;
}

.close:hover, .close-edit:hover, .close-all-invalid:hover {
    color: #333;
    background-color: #f1f1f1; /* 悬停背景 */
    transform: rotate(90deg); /* 旋转动画 */
}

/* 夜间模式适配 */
.dark .modal-content {
    background-color: #333;
    border-color: #555;
    color: #f0f0f0;
}

.dark .close, .dark .close-edit, .dark .close-all-invalid {
    color: #aaa;
}

.dark .close:hover, .dark .close-edit:hover, .dark .close-all-invalid:hover {
    color: #fff;
    background-color: #555;
}

/* 弹窗动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px); /* 从上方滑入 */
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-group {
    margin-bottom: 15px;
}
.form-group label {
    display: block;
    margin-bottom: 5px;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}
.tab {
    overflow: hidden;
    border-bottom: 1px solid #ccc;
    margin-bottom: 15px;
}
.dark .tab {
    border-bottom-color: #555;
}
.tab button {
    background-color: inherit;
    float: left;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 10px 16px;
    transition: 0.3s;
}
.tab button:hover {
    background-color: #f1f1f1;
}
.tab button.active {
    background-color: #e0e0e0;
    font-weight: bold;
}
.tabcontent {
    display: none;
    padding: 6px 12px;
}
.tabcontent.active {
    display: block;
}
.resource-item {
    cursor: pointer;
    display: flex; /* 使用flex布局 */
    flex-direction: column; /* 垂直排列 */
    height: 100%; /* 占满父容器高度 */
}
.notice-banner {
    background-color: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 10px 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}
.dark .notice-banner {
    background-color: #5c4c10;
    border-left-color: #ffc107;
}
.pagination {
    display: flex;
    justify-content: center;
    gap: 2px; /* 缩小间距 */
    margin-top: 20px;
    flex-wrap: wrap;
    align-items: center;
    font-size: 0.9rem; /* 基础字体大小 */
}

.pagination a, .pagination span {
    padding: 6px 10px; /* 减少上下内边距 */
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    background-color: #fff;
    transition: all 0.2s;
    min-width: 28px; /* 最小宽度 */
    text-align: center;
}

/* 移动端样式 */
@media (max-width: 640px) {
    .pagination {
        gap: 1px; /* 进一步缩小间距 */
        font-size: 0.8rem; /* 更小的字体 */
    }
    
    .pagination a, .pagination span {
        padding: 4px 8px; /* 更小的内边距 */
        min-width: 24px; /* 更小的最小宽度 */
    }
    
    /* 移动端隐藏跳转输入框 */
    .pagination span.ml-1 {
        display: none;
    }
}

/* 其他样式保持不变 */
.dark .pagination a, .dark .pagination span {
    background-color: #444;
    border-color: #666;
    color: #ddd;
}

.pagination a:hover:not(.disabled):not(.active) {
    background-color: #f1f1f1;
}

.dark .pagination a:hover:not(.disabled):not(.active) {
    background-color: #555;
    color: #fff;
}

.pagination a.active {
    background-color: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.pagination a.disabled {
    color: #999;
    cursor: not-allowed;
    background-color: #f9f9f9;
}

.dark .pagination a.disabled {
    background-color: #555;
    color: #777;
}

.pagination span {
    border: none;
    background: transparent;
}

/* 确保图标显示正常 */
.fas, .bi {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: middle;
}

/* 下拉菜单样式 - 修复显示问题 */
#user-menu {
    /* 移除display: none;改用visibility控制，避免布局跳动 */
    visibility: hidden;
    opacity: 0;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    min-width: 160px;
    background-color: #ffffff;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    padding: 8px 0;
    border: 1px solid #e5e7eb;
    transition: visibility 0.2s, opacity 0.2s;
}

/* 夜间模式下拉菜单 */
.dark #user-menu {
    background-color: #333;
    border-color: #555;
}

/* 显示状态 */
#user-menu.show {
    visibility: visible;
    opacity: 1;
}

#user-menu a {
    display: block;
    padding: 8px 16px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s;
}

.dark #user-menu a {
    color: #ddd;
}

#user-menu a:hover {
    background-color: #f5f5f5;
    color: #165DFF;
}

.dark #user-menu a:hover {
    background-color: #444;
    color: #fff;
}

#user-menu a i {
    margin-right: 10px;
    width: 16px;
    text-align: center;
}

#user-menu-button {
    cursor: pointer;
    display: flex;
    align-items: center;
}

#user-menu-button i:last-child {
    margin-left: 5px;
    transition: transform 0.2s;
}

#user-menu-button.active i:last-child {
    transform: rotate(180deg);
}

/* 模式切换图标样式 */
#theme-toggle {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

#theme-toggle:hover {
    background-color: rgba(59, 130, 246, 0.1);
}

#theme-toggle i {
    font-size: 1.2rem;
}

/* 手机端（屏幕宽度≤640px）隐藏资源分类 */
@media (max-width: 640px) {
    .hidden-on-mobile {
        display: none !important;
    }
}