/* ==========================================
   Yma1 资源下载站 - 自定义样式
   简约大气设计，PC/移动端完美自适应
   ========================================== */

/* CSS变量 */
:root {
    --primary: #4361ee;
    --primary-light: #7289f0;
    --primary-dark: #3451d1;
    --secondary: #6c757d;
    --success: #2ec4b6;
    --warning: #ff9f1c;
    --danger: #e63946;
    --light: #f8f9fa;
    --dark: #1a1a2e;
    --card-shadow: 0 2px 12px rgba(0,0,0,.08);
    --transition: all .3s ease;
    --radius: 12px;
}

/* 基础样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    color: #333;
    background-color: #f5f7fa;
    line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }

/* 导航栏 */
.navbar { padding: .6rem 0; }
.navbar-brand { font-size: 1.3rem; letter-spacing: .5px; }
.bg-primary { background: linear-gradient(135deg, var(--primary) 0%, #3a0ca3 100%) !important; }

/* ===== 顶部导航：渐变毛玻璃 + 智能高亮 + 悬停下拉 ===== */
.site-navbar {
    background: linear-gradient(135deg, var(--primary) 0%, #3a0ca3 100%);
    box-shadow: 0 2px 14px rgba(58, 12, 163, .28);
    padding: .5rem 0;
}
.site-navbar .navbar-brand { font-size: 1.25rem; font-weight: 700; color: #fff; display: flex; align-items: center; }
.site-navbar .nav-link {
    font-size: .92rem;
    padding: .45rem .85rem !important;
    border-radius: 8px;
    color: rgba(255, 255, 255, .82);
    transition: color .2s ease, background .2s ease;
    position: relative;
}
.site-navbar .nav-link:hover, .site-navbar .nav-link:focus { color: #fff; background: rgba(255, 255, 255, .14); }
/* 当前页高亮：胶囊底 + 底部指示条 */
.site-navbar .nav-link.active { color: #fff; background: rgba(255, 255, 255, .18); font-weight: 600; }
.site-navbar .nav-link.active::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -2px;
    width: 18px;
    height: 3px;
    border-radius: 3px;
    background: #fff;
    transform: translateX(-50%);
}
/* 下拉指示箭头与菜单项 active 的小圆点由 Bootstrap caret 保持 */

/* 下拉面板：圆角大阴影、淡入上移 */
.site-navbar .dropdown-menu {
    border: none;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(26, 26, 46, .18);
    padding: .45rem;
    margin-top: .5rem;
    font-size: .9rem;
    animation: rsDropIn .18s ease;
}
@keyframes rsDropIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.site-navbar .dropdown-item {
    border-radius: 8px;
    padding: .5rem .8rem;
    color: #444;
    transition: background .15s ease, color .15s ease;
}
.site-navbar .dropdown-item:hover { background: #eef2ff; color: var(--primary); }
.site-navbar .dropdown-item.active { background: var(--primary); color: #fff; font-weight: 600; }
.site-navbar .dropdown-item.active .badge { background: rgba(255,255,255,.9) !important; color: #b45309 !important; }

/* 桌面端：悬停展开下拉（点击仍可跳转父级链接） */
@media (min-width: 992px) {
    .site-navbar .nav-item.dropdown .dropdown-menu {
        display: block;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translateY(-4px);
        transition: opacity .18s ease, transform .18s ease, visibility .18s;
        animation: none;
    }
    .site-navbar .nav-item.dropdown:hover .dropdown-menu,
    .site-navbar .nav-item.dropdown:focus-within .dropdown-menu {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translateY(0);
    }
    /* 悬停时桥接空隙，防止鼠标斜移丢失菜单 */
    .site-navbar .nav-item.dropdown .dropdown-menu::before {
        content: '';
        position: absolute;
        top: -8px;
        left: 0;
        right: 0;
        height: 8px;
    }
}

/* 导航内搜索框：胶囊形，聚焦发光 */
.site-search .form-control {
    border: none;
    border-radius: 999px 0 0 999px;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    padding-left: .9rem;
    transition: background .2s ease, box-shadow .2s ease;
}
.site-search .form-control::placeholder { color: rgba(255, 255, 255, .65); }
.site-search .form-control:focus {
    background: rgba(255, 255, 255, .26);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .22);
    color: #fff;
}
.site-search .btn-search {
    border: none;
    border-radius: 0 999px 999px 0;
    background: rgba(255, 255, 255, .22);
    color: #fff;
    padding: 0 .85rem;
    transition: background .2s ease;
}
.site-search .btn-search:hover { background: rgba(255, 255, 255, .34); color: #fff; }

/* 导航内描边按钮（充值/注册）：恢复警示色，悬停填充 */
.site-navbar a.nav-link.btn-outline-warning { color: #ffd48f; border-color: rgba(255, 159, 28, .65); }
.site-navbar a.nav-link.btn-outline-warning:hover,
.site-navbar a.nav-link.btn-outline-warning:focus { background: var(--warning); border-color: var(--warning); color: #fff; }
.site-navbar a.nav-link.btn-outline-light { border-color: rgba(255, 255, 255, .55); }
.site-navbar a.nav-link.btn-outline-light:hover { background: #fff; color: var(--primary); }

/* 移动端：折叠菜单内项目间距与分隔 */
@media (max-width: 991.98px) {
    .site-navbar .navbar-collapse { padding-top: .6rem; }
    .site-navbar .nav-link.active::after { display: none; }
    .site-navbar .nav-link.active { background: rgba(255, 255, 255, .2); }
    .site-search { max-width: 100%; margin: .5rem 0; }
    .site-navbar .dropdown-menu { background: rgba(255, 255, 255, .1); box-shadow: none; }
    .site-navbar .dropdown-item { color: rgba(255, 255, 255, .85); }
    .site-navbar .dropdown-item:hover { background: rgba(255, 255, 255, .14); color: #fff; }
    .site-navbar .dropdown-item.active { background: rgba(255, 255, 255, .25); color: #fff; }
    .site-navbar .dropdown-divider { border-color: rgba(255, 255, 255, .2); }
}

/* ===== 公告栏：无缝滚动，悬停暂停 ===== */
.notice-bar { background: #fff; }
.notice-viewport { max-width: 100%; }
.notice-track {
    display: inline-flex;
    white-space: nowrap;
    animation: rsNoticeScroll 24s linear infinite;
    will-change: transform;
}
.notice-track .notice-text { padding-right: 4rem; color: #555; }
.notice-viewport:hover .notice-track { animation-play-state: paused; }
@keyframes rsNoticeScroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
    .notice-track { animation: none; }
    .site-navbar .dropdown-menu { animation: none; }
}

/* 卡片样式 */
.card {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    overflow: hidden;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 8px 25px rgba(0,0,0,.12); }
.card-header { background: #fff; border-bottom: 1px solid #f0f0f0; font-weight: 600; }

/* 资源卡片 */
.resource-card { height: 100%; }
.resource-card .card-img-top {
    height: 180px;
    object-fit: cover;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.resource-card .card-img-top.placeholder-img {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
/* 点阵纹理 + 顶部柔光，磨砂图标底座，质感更自然 */
.resource-card .card-img-top.placeholder-img::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,.16) 1px, transparent 1.5px);
    background-size: 14px 14px;
}
.resource-card .card-img-top.placeholder-img::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,0) 40%, rgba(0,0,0,.14));
}
.resource-card .card-img-top.placeholder-img i {
    position: relative;
    z-index: 2;
    font-size: 1.9rem;
    width: 64px;
    height: 64px;
    line-height: 62px;
    text-align: center;
    border-radius: 18px;
    color: #fff;
    background: rgba(255,255,255,.16);
    border: 1px solid rgba(255,255,255,.28);
    backdrop-filter: blur(4px);
    box-shadow: 0 8px 20px rgba(0,0,0,.18);
    transition: var(--transition);
}
.resource-card:hover .card-img-top.placeholder-img i { transform: scale(1.08) rotate(-4deg); }
/* 页脚链接悬停变白 */
footer .hover-white:hover { color: #fff !important; transition: color .2s; }

/* 占位封面渐变风格（按资源ID分配，共20套，多色系低饱和） */
.ph-g1 { background: linear-gradient(135deg, #4f6df5 0%, #3648c9 100%); }
.ph-g2 { background: linear-gradient(135deg, #f0706b 0%, #d84a63 100%); }
.ph-g3 { background: linear-gradient(135deg, #35b8a5 0%, #1e8f83 100%); }
.ph-g4 { background: linear-gradient(135deg, #f2a541 0%, #dd7f2a 100%); }
.ph-g5 { background: linear-gradient(135deg, #7b6cf6 0%, #5a49d8 100%); }
.ph-g6 { background: linear-gradient(135deg, #3d8bfd 0%, #2668d8 100%); }
.ph-g7 { background: linear-gradient(135deg, #5f7285 0%, #414f5e 100%); }
.ph-g8 { background: linear-gradient(135deg, #e8c33d 0%, #c99a1f 100%); }
.ph-g9 { background: linear-gradient(135deg, #e786a4 0%, #c95c7f 100%); }
.ph-g10 { background: linear-gradient(135deg, #52a675 0%, #357e53 100%); }
.ph-g11 { background: linear-gradient(135deg, #946ff0 0%, #6f47d1 100%); }
.ph-g12 { background: linear-gradient(135deg, #4aa3c0 0%, #2f7d99 100%); }
.ph-g13 { background: linear-gradient(135deg, #d97b4f 0%, #b5542c 100%); }
.ph-g14 { background: linear-gradient(135deg, #8fae5b 0%, #6a8a3c 100%); }
.ph-g15 { background: linear-gradient(135deg, #5b8def 0%, #3f6cd0 100%); }
.ph-g16 { background: linear-gradient(135deg, #43b7ae 0%, #2a918a 100%); }
.ph-g17 { background: linear-gradient(135deg, #ef8354 0%, #d05f2f 100%); }
.ph-g18 { background: linear-gradient(135deg, #b06ab3 0%, #8a4a91 100%); }
.ph-g19 { background: linear-gradient(135deg, #45c4b0 0%, #2ba08f 100%); }
.ph-g20 { background: linear-gradient(135deg, #e6685e 0%, #c74440 100%); }
.resource-card .card-body { padding: 1rem; }
.resource-card .card-title {
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: .5rem;
}
.resource-card .card-text {
    font-size: .82rem;
    color: #888;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.resource-card .card-footer {
    background: #fff;
    border-top: 1px solid #f0f0f0;
    padding: .5rem 1rem;
    font-size: .8rem;
    color: #999;
}

/* 标签/Badge */
.badge-type {
    font-size: .72rem;
    padding: .25rem .5rem;
    border-radius: 4px;
    font-weight: 500;
}
.badge-software { background: #dbeafe; color: #1e40af; }
.badge-video { background: #fce7f3; color: #be185d; }
.badge-article { background: #d1fae5; color: #065f46; }
.tag-item {
    display: inline-block;
    background: #eef2ff;
    color: var(--primary);
    font-size: .75rem;
    padding: .15rem .5rem;
    border-radius: 4px;
    margin: 2px;
}

/* 按钮 */
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); border-color: var(--primary); }
.btn-download {
    background: linear-gradient(135deg, var(--success), #20a898);
    color: #fff;
    border: none;
    padding: .6rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    transition: var(--transition);
}
.btn-download:hover { transform: translateY(-2px); color: #fff; box-shadow: 0 4px 15px rgba(46,196,182,.4); }

/* 侧边栏 */
.sidebar .card { margin-bottom: 1.5rem; }
.sidebar .list-group-item {
    border: none;
    padding: .6rem 1rem;
    border-radius: 6px !important;
    margin-bottom: 2px;
    transition: var(--transition);
}
.sidebar .list-group-item:hover { background: #eef2ff; color: var(--primary); }

/* 资源详情页 */
.resource-detail .content-body {
    line-height: 1.8;
    font-size: .95rem;
}
.resource-detail .content-body img { max-width: 100%; border-radius: 8px; margin: 1rem 0; }
.resource-detail .content-body h2, .resource-detail .content-body h3 { margin: 1.5rem 0 .8rem; font-weight: 600; }
.resource-detail .content-body pre {
    background: #1e1e2e;
    color: #cdd6f4;
    padding: 1.2rem;
    border-radius: 8px;
    overflow-x: auto;
}
.resource-detail .content-body code { background: #f1f3f5; padding: .15rem .4rem; border-radius: 3px; font-size: .88em; color: #e63946; }
.resource-detail .content-body pre code { background: none; padding: 0; color: inherit; }
.resource-detail .content-body blockquote {
    border-left: 4px solid var(--primary);
    padding: .8rem 1.2rem;
    margin: 1rem 0;
    background: #f8f9ff;
    border-radius: 0 8px 8px 0;
}
.resource-detail .content-body table { width: 100%; margin: 1rem 0; border-collapse: collapse; font-size: .92rem; }
.resource-detail .content-body table th, .resource-detail .content-body table td { border: 1px solid #dee2e6; padding: .5rem .75rem; }
.resource-detail .content-body table th { background: #f8f9fa; }
.resource-detail .content-body ul, .resource-detail .content-body ol { padding-left: 1.5rem; margin: .8rem 0; }
.resource-detail .content-body a { color: var(--primary); }
.resource-detail .content-body video { max-width: 100%; border-radius: 8px; margin: 1rem 0; }

/* 富文本编辑器(wangEditor)外观 */
.editor-wrap {
    border: 1px solid #dee2e6;
    border-radius: .375rem;
    overflow: hidden;
    position: relative;
    z-index: 10;
    background: #fff;
}
.editor-wrap #editorToolbar { border-bottom: 1px solid #e8e8e8; background: #fafafa; }
.editor-wrap #editorContent { height: 380px; overflow-y: hidden; }
.editor-wrap .w-e-text-container { min-height: 380px; }

/* 下载信息面板 */
.download-panel {
    background: linear-gradient(135deg, #f8f9ff 0%, #eef2ff 100%);
    border: 1px solid #dde3f7;
    border-radius: var(--radius);
    padding: 1.5rem;
}
.download-panel .info-row {
    display: flex;
    justify-content: space-between;
    padding: .5rem 0;
    border-bottom: 1px dashed #e0e5f0;
}
.download-panel .info-row:last-child { border-bottom: none; }

/* 评论区 */
.comment-item {
    padding: 1rem 0;
    border-bottom: 1px solid #f0f0f0;
}
.comment-item:last-child { border-bottom: none; }
.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

/* 表单样式 */
.form-control:focus, .form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 .2rem rgba(67,97,238,.15);
}
.form-label { font-weight: 500; font-size: .9rem; margin-bottom: .4rem; }

/* 登录/注册页 */
.auth-container {
    max-width: 420px;
    margin: 2rem auto;
}
.auth-card {
    padding: 2.5rem;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
}
.auth-card h3 { font-weight: 700; margin-bottom: 1.5rem; text-align: center; }

/* 个人中心 */
.user-stats {
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    text-align: center;
}
.user-stats .stat-item {
    flex: 1 1 0;
    min-width: 0;
    padding: .5rem .15rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .15rem;
    position: relative;
}
.user-stats .stat-item + .stat-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 15%;
    bottom: 15%;
    width: 1px;
    background: linear-gradient(to bottom, transparent, #e0e5f0, transparent);
}
.user-stats .stat-icon {
    font-size: .9rem;
    margin-bottom: .1rem;
    opacity: .85;
}
.user-stats .stat-number {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.user-stats .stat-label {
    font-size: .72rem;
    color: #888;
    white-space: nowrap;
}
@media (max-width: 767px) {
    .user-stats .stat-number { font-size: 1rem; }
    .user-stats .stat-icon { font-size: .85rem; }
}

/* 签到按钮 */
.btn-checkin {
    background: linear-gradient(135deg, var(--warning), #ff8800);
    color: #fff;
    border: none;
    padding: .5rem 1.5rem;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}
.btn-checkin:hover { transform: scale(1.05); color: #fff; }
.btn-checkin:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* 金币/积分显示 */
.coin-display {
    display: inline-flex;
    align-items: center;
    background: #fff8e1;
    color: #f59e0b;
    padding: .2rem .6rem;
    border-radius: 12px;
    font-size: .82rem;
    font-weight: 600;
}
.coin-display .paid-tag {
    margin-right: .4rem;
    padding-right: .4rem;
    border-right: 1px solid rgba(245,158,11,.35);
    color: #d97706;
}

/* 导航归属徽章（全站统一） */
.badge-nav {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-weight: 500;
    letter-spacing: .3px;
}

/* 回到顶部按钮 */
.back-top {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 1000;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--primary), #3a0ca3);
    color: #fff;
    font-size: 1.1rem;
    box-shadow: 0 6px 18px rgba(67, 97, 238, .35);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
}
.back-top.show { opacity: 1; visibility: visible; transform: none; }
.back-top:hover { transform: translateY(-3px); color: #fff; }

/* 分页 */
.pagination .page-link {
    color: var(--primary);
    border-radius: 6px;
    margin: 0 2px;
    border: 1px solid #e0e5f0;
}
.pagination .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* 搜索页 */
.search-highlight { background: #fef08a; padding: 1px 2px; border-radius: 2px; }

/* 点赞/收藏按钮 */
.btn-action {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .4rem .8rem;
    border: 1px solid #e0e5f0;
    border-radius: 20px;
    font-size: .85rem;
    color: #666;
    background: #fff;
    cursor: pointer;
    transition: var(--transition);
}
.btn-action:hover { border-color: var(--primary); color: var(--primary); }
.btn-action.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 后台样式 */
.admin-sidebar {
    background: var(--dark);
    min-height: 100vh;
    padding-top: 1rem;
}
.admin-sidebar .nav-link {
    color: rgba(255,255,255,.7);
    padding: .6rem 1.2rem;
    font-size: .88rem;
    border-radius: 0;
    transition: var(--transition);
}
.admin-sidebar .nav-link:hover, .admin-sidebar .nav-link.active {
    color: #fff;
    background: rgba(255,255,255,.1);
}
.admin-sidebar .nav-link i { width: 20px; text-align: center; margin-right: .5rem; }
.admin-sidebar .sidebar-header {
    color: rgba(255,255,255,.4);
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 1rem 1.2rem .5rem;
    font-weight: 600;
}

/* 统计卡片 */
.stat-card {
    border: none;
    border-radius: var(--radius);
    padding: 1.5rem;
    color: #fff;
}
.stat-card.bg-gradient-1 { background: linear-gradient(135deg, #667eea, #764ba2); }
.stat-card.bg-gradient-2 { background: linear-gradient(135deg, #f093fb, #f5576c); }
.stat-card.bg-gradient-3 { background: linear-gradient(135deg, #4facfe, #00f2fe); }
.stat-card.bg-gradient-4 { background: linear-gradient(135deg, #43e97b, #38f9d7); }
.stat-card .stat-icon { font-size: 2.5rem; opacity: .3; }
.stat-card .stat-value { font-size: 2rem; font-weight: 700; }

/* 表格样式 */
.table th { font-weight: 600; font-size: .85rem; color: #666; background: #f8f9fc; border: none; }
.table td { vertical-align: middle; font-size: .88rem; }
.table-hover tbody tr:hover { background: #f8f9ff; }

/* 响应式优化 */
@media (max-width: 991px) {
    .admin-sidebar { min-height: auto; padding: .5rem 0; }
    .resource-card .card-img-top { height: 140px; }
}
@media (max-width: 767px) {
    .auth-card { padding: 1.5rem; margin: 1rem; }
    .download-panel { padding: 1rem; }
    main.container { padding-left: .8rem; padding-right: .8rem; }
    .resource-card .card-img-top { height: 120px; }
    .resource-card .card-title { font-size: .85rem; }
    .user-stats .stat-number { font-size: 1.3rem; }
}
@media (max-width: 575px) {
    .navbar-brand { font-size: 1.1rem; }
    .pagination { font-size: .82rem; }
}

/* 动画 */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.fade-in { animation: fadeIn .4s ease-out; }

/* 滚动条美化 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #999; }

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #999;
}
.empty-state i { font-size: 4rem; margin-bottom: 1rem; opacity: .3; }

/* 密码验证卡片（居中友好） */
.password-card {
    border: none;
    border-radius: var(--radius);
}
.password-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffc107, #ff9800);
    color: #fff;
    font-size: 1.8rem;
    box-shadow: 0 4px 14px rgba(255, 152, 0, .35);
}
/* 密码错误抖动动画 */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}
.shake { animation: shake .4s ease; }

/* Toast通知 */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
}

/* ==========================================
   二级分类导航标签栏（通用模板）
   ========================================== */
.category-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
}
.category-tag {
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 0.85rem;
    transition: all 0.2s ease;
    border: 1px solid #dee2e6;
}
.category-tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,.1);
}
.category-tag.btn-primary {
    background: var(--bs-primary);
    border-color: var(--bs-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(67,97,238,.3);
}
.category-tag.btn-outline-secondary:hover {
    background: var(--bs-primary);
    border-color: var(--bs-primary);
    color: #fff;
}

/* ==========================================
   侧栏榜单列表（热门下载/相关推荐/最新上传）
   ========================================== */
.side-rank-row {
    display: flex;
    align-items: center;
    gap: .55rem;
    padding: .4rem .5rem;
    border-radius: 8px;
    color: #333;
    transition: var(--transition);
}
.side-rank-row + .side-rank-row { margin-top: 2px; }
.side-rank-row:hover { background: #eef2ff; color: var(--primary); }
.side-rank-row .rank {
    flex: 0 0 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    border-radius: 6px;
    font-size: .72rem;
    font-weight: 700;
    background: #eef1f6;
    color: #98a1b3;
}
.side-rank-row .rank.r1 { background: linear-gradient(135deg, #ff6b6b, #e63946); color: #fff; }
.side-rank-row .rank.r2 { background: linear-gradient(135deg, #ffa94d, #ff9f1c); color: #fff; }
.side-rank-row .rank.r3 { background: linear-gradient(135deg, #ffd43b, #fab005); color: #fff; }
.side-rank-row .info { flex: 1 1 auto; min-width: 0; }
.side-rank-row .t {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: .85rem;
}
.side-rank-row .meta { font-size: .72rem; color: #98a1b3; }
.side-rank-row:hover .meta { color: var(--primary-light); }

/* 榜单卡片头部切换标签 */
.rank-tabs .nav-link {
    font-size: .78rem;
    padding: .15rem .6rem;
    border-radius: 20px;
    color: #8a94a6;
    background: transparent;
}
.rank-tabs .nav-link:hover { background: #eef2ff; color: var(--primary); }
.rank-tabs .nav-link.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(67,97,238,.3);
}

/* ==========================================
   站点统计卡（侧栏，柔和色块九宫格风格）
   ========================================== */
.site-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}
.site-stat-item {
    border-radius: 8px;
    padding: .55rem .25rem .45rem;
    text-align: center;
    background: #f6f8fc;
    transition: var(--transition);
}
.site-stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(31,45,61,.08);
}
.site-stat-item i { font-size: .9rem; display: block; margin-bottom: 2px; }
.site-stat-item .v {
    font-size: .92rem;
    font-weight: 700;
    color: #2b3648;
    line-height: 1.25;
    font-variant-numeric: tabular-nums;
}
.site-stat-item .l { font-size: .68rem; color: #98a1b3; margin-top: 1px; }
.site-stat-item.c1 { background: #eef2ff; } .site-stat-item.c1 i { color: #4361ee; }
.site-stat-item.c2 { background: #e9faf8; } .site-stat-item.c2 i { color: #2ec4b6; }
.site-stat-item.c3 { background: #f3f0ff; } .site-stat-item.c3 i { color: #845ef7; }
.site-stat-item.c4 { background: #fff6e9; } .site-stat-item.c4 i { color: #ff9f1c; }
.site-stat-item.c5 { background: #fdecee; } .site-stat-item.c5 i { color: #e63946; }
.site-stat-item.c6 { background: #ebf5ff; } .site-stat-item.c6 i { color: #339af0; }

/* ==========================================
   「发布资源」按钮（首页/列表页/用户中心统一样式）
   ========================================== */
.btn-publish {
    background: var(--primary, #4361ee);
    border: 1px solid var(--primary, #4361ee);
    color: #fff;
    border-radius: 8px;
    font-weight: 500;
    padding: .5rem 1rem;
    transition: var(--transition);
}
.btn-publish:hover, .btn-publish:focus {
    background: #3451d1;
    border-color: #3451d1;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(67,97,238,.3);
}
.btn-publish i { font-size: .9em; }
.btn-publish.btn-sm { padding: .25rem .6rem; border-radius: 6px; }
.btn-publish.w-100 { padding: .6rem 1rem; border-radius: 10px; }
