/* ===== 二梦资源社 · 全盘导航 · 视觉样式 ===== */
:root {
    --accent: #6a5cff;
    --accent2: #00c2ff;
    --bg: #f4f6fc;
    --card: #ffffff;
    --text: #1f2330;
    --muted: #8a90a2;
    --radius: 16px;
    --shadow-sm: 0 2px 10px rgba(31, 35, 48, .06);
    --shadow: 0 8px 26px rgba(31, 35, 48, .09);
    --shadow-lg: 0 18px 44px rgba(106, 92, 255, .24);
    --ease: cubic-bezier(.4, 0, .2, 1);
}

* { box-sizing: border-box; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
    /* 极致清晰：字号、行高、字间距统一调优 */
    font-size: 15px;
    line-height: 1.65;
    letter-spacing: .2px;
    -webkit-font-smoothing: antialiased;
}

/* 全站默认过渡，操作行云流水 */
a, button, input, select, textarea, .card, .list-group-item, .badge {
    transition: all .22s var(--ease);
}

/* ---------- 顶栏 ---------- */
.topbar {
    position: sticky; top: 0; z-index: 60; margin-left: 224px;
    background: linear-gradient(120deg, #6a5cff, #00c2ff);
    box-shadow: 0 4px 22px rgba(106, 92, 255, .28);
    padding: .55rem 0;
    display: flex; align-items: center;
}
.topbar > * { margin-left: 8px; margin-right: 8px; }
.topbar .brand {
    color: #fff; font-weight: 700; font-size: 1.15rem; letter-spacing: .8px;
    text-decoration: none; white-space: nowrap;
}
.topbar .brand:hover { opacity: .9; }
/* 顶部居中的品牌字 */
.brand-center {
    position: absolute; left: 50%; top: 50%;
    transform: translate(calc(-50% - 112px), -50%);
    color: #fff; font-weight: 800; font-size: 1.18rem;
    letter-spacing: 2px; white-space: nowrap; pointer-events: none;
    text-shadow: 0 2px 10px rgba(0, 0, 0, .18);
}
/* 右上角不显眼的齿轮（后台入口） */
.brand-gear {
    color: rgba(255, 255, 255, .55); font-size: 1.05rem; line-height: 1;
    text-decoration: none; transition: color .2s, transform .3s; flex: none;
    margin-left: 2px;
}
.brand-gear:hover { color: #fff; transform: rotate(60deg); }
/* 搜索框在桌面端自适应撑开，推到右侧 */
.search-wrap { flex: 0 1 auto; min-width: 0; margin-left: auto; }
/* 搜索图标：仅手机端显示，桌面端隐藏 */
.search-toggle { display: none; }
/* 汉堡按钮（手机显示） */
.menu-btn {
    display: none; width: 38px; height: 34px; line-height: 1;
    border: none; border-radius: 9px; background: rgba(255, 255, 255, .18);
    color: #fff; font-size: 1.15rem; cursor: pointer; flex: none;
}
.menu-btn:hover { background: rgba(255, 255, 255, .3); }

/* ---------- 左侧分类侧边栏 ---------- */
.sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 224px; z-index: 70;
    background: #fff; border-right: 1px solid #eceefb;
    box-shadow: 2px 0 22px rgba(31, 35, 48, .06);
    display: flex; flex-direction: column;
    transition: transform .26s var(--ease);
}
.side-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.1rem .7rem;
    background: linear-gradient(120deg, #6a5cff, #00c2ff);
    color: #fff;
}
.side-title { font-weight: 700; letter-spacing: 1px; font-size: .95rem; }
.side-close {
    display: none; background: rgba(255, 255, 255, .2); border: none;
    color: #fff; width: 28px; height: 28px; border-radius: 8px; cursor: pointer;
}
.side-nav { flex: 1; overflow-y: auto; padding: .6rem .55rem; }
.side-item {
    display: flex; align-items: center; gap: 10px;
    padding: .6rem .8rem; margin-bottom: 3px; border-radius: 11px;
    color: #4a4f60; text-decoration: none; font-weight: 600; font-size: .92rem;
    position: relative;
}
.side-item:hover { background: #f3f4fd; color: var(--accent); transform: translateX(2px); }
.side-item.active {
    background: linear-gradient(120deg, #6a5cff, #00c2ff); color: #fff;
    box-shadow: 0 6px 18px rgba(106, 92, 255, .3);
}
.side-ico { font-size: 1.05rem; font-style: normal; flex: none; }
.side-name { flex: 1; }
.side-num {
    font-size: .72rem; font-weight: 700; background: #eef0f8; color: #6b7080;
    border-radius: 999px; padding: 1px 8px; flex: none;
}
.side-item.active .side-num { background: rgba(255, 255, 255, .26); color: #fff; }
.side-foot {
    padding: .8rem 1rem; border-top: 1px solid #f1f2f7; text-align: center;
}
.side-foot a { color: var(--muted); font-size: .84rem; text-decoration: none; }
.side-foot a:hover { color: var(--accent); }
/* 主内容区（桌面给侧边栏让位） */
.content { margin-left: 224px; }
/* 手机遮罩 */
.side-mask {
    position: fixed; inset: 0; background: rgba(20, 22, 33, .45);
    z-index: 65; opacity: 0; pointer-events: none; transition: opacity .26s var(--ease);
}
.side-mask.show { opacity: 1; pointer-events: auto; }

/* ---------- 分类标签 ---------- */
.cat-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.cat-pill {
    padding: .55rem 1.25rem; border-radius: 999px; font-weight: 600; font-size: .95rem;
    background: #fff; color: var(--text); text-decoration: none;
    box-shadow: var(--shadow-sm); border: 1px solid rgba(106, 92, 255, .08);
}
.cat-pill:hover {
    transform: translateY(-3px); color: var(--accent);
    box-shadow: 0 8px 20px rgba(106, 92, 255, .18);
}
.cat-pill.active {
    background: linear-gradient(120deg, #6a5cff, #00c2ff); color: #fff;
    box-shadow: 0 8px 22px rgba(106, 92, 255, .38);
    transform: translateY(-2px);
}
.sub-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.sub-pill {
    padding: .38rem .95rem; border-radius: 999px; font-size: .9rem;
    background: #eef0f8; color: #5b6070; text-decoration: none;
}
.sub-pill:hover { background: #e3e6f7; color: var(--accent); transform: translateY(-2px); }
.sub-pill.active {
    background: linear-gradient(120deg, #6a5cff, #00c2ff); color: #fff;
    box-shadow: 0 5px 14px rgba(106, 92, 255, .3);
}
.sub-row-3 .sub-pill.sm { padding: .3rem .8rem; font-size: .84rem; background: #f2f3f9; }

/* ---------- 影视 / 动漫：卡片模式 ---------- */
.res-card {
    border: none; border-radius: var(--radius); overflow: hidden; background: var(--card);
    box-shadow: var(--shadow);
}
.res-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}
/* 封面容器：悬停时图片缓慢放大 + 渐变遮罩浮现 */
.cover-wrap { position: relative; overflow: hidden; height: auto; aspect-ratio: 2 / 3; background: #eef0f7; }
.card-cover {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.res-card:hover .card-cover { transform: scale(1.08); }
.cover-mask {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(31, 35, 48, 0) 40%, rgba(31, 35, 48, .55) 100%);
    opacity: 0; display: flex; align-items: flex-end; justify-content: center;
    padding-bottom: 14px;
}
.res-card:hover .cover-mask { opacity: 1; }
.cover-mask span {
    color: #fff; font-size: .85rem; font-weight: 700; letter-spacing: 1px;
    transform: translateY(8px);
}
.res-card:hover .cover-mask span { transform: translateY(0); }

/* 自动占位：标题哈希生成专属渐变，并显示标题文字 */
.card-cover.ph {
    display: flex; flex-direction: column; gap: 4px;
    align-items: center; justify-content: center; color: #fff;
    font-weight: 800; letter-spacing: 2px; text-align: center; padding: 0 14px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, .28);
}
.card-cover.ph .ph-text { font-size: 1.35rem; line-height: 1.3; }
.card-cover.ph .ph-sub {
    font-size: .68rem; font-weight: 600; letter-spacing: 3px;
    opacity: .8; text-shadow: none;
}
.res-card:hover .card-cover.ph { transform: scale(1.05); }

/* ---------- 网盘标识 ---------- */
.pan-tag {
    position: absolute; top: 8px; left: 8px; z-index: 3;
    color: #fff; font-size: .7rem; font-weight: 700; letter-spacing: .5px;
    padding: 3px 9px; border-radius: 7px;
    box-shadow: 0 4px 12px rgba(31, 35, 48, .25);
    backdrop-filter: blur(4px);
}
.pan-tag i {
    font-style: normal; opacity: .85; margin-left: 2px;
    background: rgba(255, 255, 255, .25); border-radius: 4px; padding: 0 3px;
}
/* 多网盘来源：一排彩色网盘按钮 */
.pan-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.pan-btn {
    flex: 1 1 auto; min-width: 62px;
    color: #fff; font-size: .78rem; font-weight: 700; text-align: center;
    padding: .42rem .5rem; border-radius: 9px; text-decoration: none;
    display: inline-flex; align-items: center; justify-content: center; gap: 4px;
    box-shadow: 0 4px 12px rgba(31, 35, 48, .16);
    transition: transform .18s var(--ease), box-shadow .18s var(--ease), filter .18s;
    white-space: nowrap;
}
.pan-btn em {
    font-style: normal; font-size: .66rem; font-weight: 600;
    background: rgba(255, 255, 255, .22); border-radius: 4px; padding: 1px 4px;
}
.pan-btn:hover {
    color: #fff; transform: translateY(-2px); filter: brightness(1.08);
    box-shadow: 0 8px 20px rgba(31, 35, 48, .24);
}
.pan-btn:active { transform: translateY(0); }
.pan-btn.sm {
    flex: 0 0 auto; min-width: 0; font-size: .72rem;
    padding: .3rem .6rem; border-radius: 7px; box-shadow: none;
}
.pan-btn.sm:hover { box-shadow: 0 5px 14px rgba(31, 35, 48, .22); }
/* 网盘筛选行 */
.pan-row { align-items: center; flex-wrap: wrap; }
.pan-label {
    font-size: .78rem; font-weight: 700; color: var(--muted);
    margin-right: 2px; letter-spacing: 1px;
}
.pan-pill { display: inline-flex; align-items: center; gap: 5px; }
.pan-dot {
    width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none;
}
.sub-pill.active .pan-dot { box-shadow: 0 0 0 2px rgba(255, 255, 255, .8); }
/* 后台网盘分布 */
.pan-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.pan-chip {
    display: inline-flex; align-items: center; gap: 6px;
    background: #f6f7fd; border: 1px solid #eceefb;
    padding: 7px 13px; border-radius: 999px; font-size: .84rem; font-weight: 600;
}
/* 后台：资源条目下的网盘来源小标签 */
.pan-mini {
    display: inline-flex; align-items: center; gap: 4px;
    color: #fff; font-size: .72rem; font-weight: 600;
    padding: 3px 6px 3px 9px; border-radius: 7px;
}
.pan-mini .x {
    background: rgba(255, 255, 255, .22); border: none; color: #fff;
    width: 16px; height: 16px; line-height: 1; border-radius: 50%;
    font-size: .8rem; cursor: pointer; padding: 0; opacity: .85;
}
.pan-mini .x:hover { background: rgba(255, 255, 255, .45); opacity: 1; }

.pan-chip b { color: var(--accent); font-size: .95rem; }
.pan-chip em { font-style: normal; font-size: .72rem; color: var(--muted); font-weight: 500; }

.card-body { padding: .42rem .55rem .48rem; }
/* 片名：允许换行完整显示，最多两行 */
.card-title {
    font-size: .88rem; line-height: 1.35; margin: 0; font-weight: 600; color: var(--text);
    white-space: normal; overflow: hidden; text-overflow: clip;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
/* 提取码小标签：绝对定位在封面底部，不增加卡片高度 */
.code-chip {
    position: absolute; right: 6px; bottom: 6px; z-index: 3;
    background: rgba(20, 22, 33, .62); color: #fff; backdrop-filter: blur(2px);
    font-size: .62rem; font-weight: 600; letter-spacing: .5px;
    padding: 2px 7px; border-radius: 7px;
}
.code-chip b { color: #ffe27a; }
.card-code b { color: var(--accent); letter-spacing: .5px; }
.btn-go {
    background: linear-gradient(120deg, #6a5cff, #00c2ff); border: none; color: #fff;
    border-radius: 10px; font-weight: 600; font-size: .86rem; padding: .5rem 0;
    box-shadow: 0 4px 12px rgba(106, 92, 255, .25);
}
.btn-go:hover {
    color: #fff; transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(106, 92, 255, .38);
    filter: brightness(1.05);
}
.btn-go:active { transform: translateY(0); }

/* ---------- 资料 / 瑜伽：列表模式 ---------- */
.list-clean {
    border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow); background: #fff;
}
.li-res {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; border: none; border-bottom: 1px solid #f1f2f7;
    padding: .85rem 1.1rem; position: relative; background: transparent;
    color: var(--text); transition: background .2s, padding-left .2s;
}
.li-res:last-child { border-bottom: none; }
.li-info { display: flex; align-items: center; gap: 7px; min-width: 0; flex: 1; overflow: hidden; }
.li-info .fw-medium {
    min-width: 0; flex: 1; line-height: 1.45;
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3;
    overflow: hidden;
}
.li-res .pan-tag.sm { flex: none; position: static; top: auto; left: auto; }
/* 悬停：左侧色条 + 背景微亮 */
.li-res::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
    background: linear-gradient(180deg, #6a5cff, #00c2ff);
    transform: scaleY(0); transform-origin: center;
}
.li-res:hover { background: #fafbff; padding-left: 1.35rem; }
.li-res:hover::before { transform: scaleY(1); }
.badge.bg-soft {
    background: #eef0fb; color: var(--accent);
    font-weight: 600; font-size: .76rem; padding: .35em .7em; border-radius: 7px;
}
.list-clean .fw-medium { font-weight: 600; font-size: .95rem; }

/* ---------- 求片留言区 ---------- */
.wish-card {
    background: #fff; border-radius: var(--radius);
    box-shadow: var(--shadow); overflow: hidden;
}
.wish-head {
    padding: .8rem 1.15rem; font-weight: 700; font-size: .95rem; color: #fff;
    background: linear-gradient(120deg, #6a5cff, #00c2ff);
}
.wish-body { padding: 1.1rem; }
.wish-tip { font-size: .86rem; color: #5b6070; margin-bottom: .9rem; }
.wish-list .list-group-item { border-color: #f1f2f7; padding: .8rem 1.15rem; }
.wish-list .list-group-item:hover { background: #fafbff; }
.wish-name { font-size: .9rem; }
.wish-text { font-size: .92rem; margin-top: .3rem; color: var(--text); }
.wish-reply {
    margin-top: .4rem; font-size: .82rem; color: #0a7a5a;
    background: #eafaf4; border-radius: 8px; padding: .35rem .6rem;
}
.wish-status {
    font-size: .68rem; font-weight: 700; border-radius: 6px;
    padding: 1px 7px; margin-left: 6px; vertical-align: middle;
}
.st-wait { background: #fff2e0; color: #b26a00; }
.st-done { background: #e6f7ef; color: #0a7a5a; }

/* ---------- 空状态 ---------- */
.empty-state { text-align: center; padding: 66px 0; color: var(--muted); }
.empty-state .empty-emoji { font-size: 3.2rem; margin-bottom: .6rem; }

/* ---------- 分页 ---------- */
.pager {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
    gap: 6px; margin-top: 1.6rem;
}
.pager .pg-info { width: 100%; text-align: center; color: var(--muted); font-size: .82rem; margin-bottom: 4px; }
.pg-btn {
    min-width: 38px; text-align: center; padding: 7px 11px; border-radius: 10px;
    font-size: .88rem; font-weight: 600; text-decoration: none; color: #4a4f60;
    background: #fff; border: 1px solid #e6e8f2; transition: all .15s ease;
}
.pg-btn:hover:not(.disabled):not(.active) { border-color: #6a5cff; color: #6a5cff; }
.pg-btn.active {
    background: linear-gradient(120deg, #6a5cff, #00c2ff); color: #fff; border-color: transparent;
}
.pg-btn.disabled { opacity: .45; pointer-events: none; cursor: not-allowed; }
.pager .pg-main {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px;
}
.pager .pg-numbers {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin-top: 8px;
}
.pager.collapsed .pg-numbers { display: none; }
.pg-toggle {
    min-width: 38px; text-align: center; padding: 7px 11px; border-radius: 10px;
    font-size: .88rem; font-weight: 600; cursor: pointer; color: #4a4f60;
    background: #fff; border: 1px solid #e6e8f2; transition: all .15s ease;
}
.pg-toggle:hover { border-color: #6a5cff; color: #6a5cff; }
.pg-toggle .arw { display: inline-block; transition: transform .15s ease; }
.pager:not(.collapsed) .pg-toggle .arw { transform: rotate(180deg); }

/* ---------- 后台 ---------- */
.admin-card { border-radius: var(--radius); box-shadow: var(--shadow); border: none; overflow: hidden; }
.admin-card .card-header {
    background: linear-gradient(120deg, #6a5cff, #00c2ff); color: #fff;
    border: none; font-weight: 600; font-size: .95rem; padding: .75rem 1.1rem;
}
.form-label { font-weight: 600; font-size: .88rem; color: #4a4f60; }
.form-control, .form-select {
    border-radius: 10px; border: 1px solid #e6e8f2; padding: .55rem .8rem; font-size: .92rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(106, 92, 255, .14);
}
.btn { border-radius: 10px; font-weight: 600; }
.btn:hover { transform: translateY(-1px); }

/* 数据总览：统计卡 */
.stat-grid {
    display: grid; gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.stat-card {
    background: #fff; border-radius: var(--radius); padding: 1.05rem 1.15rem;
    box-shadow: var(--shadow); display: flex; align-items: center; gap: 14px;
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.stat-icon {
    width: 46px; height: 46px; border-radius: 13px; flex: none;
    display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
    box-shadow: 0 6px 16px rgba(31, 35, 48, .12);
}
.stat-num { font-size: 1.7rem; font-weight: 800; line-height: 1.1; color: var(--text); }
.stat-label { font-size: .82rem; color: var(--muted); font-weight: 600; }

/* 分类统计条 */
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; }
.bar-row:last-child { margin-bottom: 0; }
.bar-name { width: 92px; flex: none; font-size: .86rem; font-weight: 600; }
.bar-name em {
    font-style: normal; font-size: .68rem; color: var(--muted);
    font-weight: 500; margin-left: 4px;
}
.bar-track {
    flex: 1; height: 12px; background: #f0f1f7;
    border-radius: 999px; overflow: hidden;
}
.bar-fill {
    height: 100%; border-radius: 999px; min-width: 3px;
    animation: barIn .7s var(--ease);
}
@keyframes barIn { from { width: 0 !important; } }
.bar-val { width: 30px; text-align: right; font-weight: 700; font-size: .88rem; color: var(--accent); }

/* 最新动态 */
.feed .list-group-item { padding: .7rem 1.1rem; }
.feed .list-group-item:hover { background: #fafbff; }
.feed-title {
    font-weight: 600; font-size: .88rem; overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap; max-width: 78%;
}
.feed-path { font-size: .74rem; color: var(--muted); }

/* ==========================================================================
   移动端适配：字体 / 图片整体收紧，触屏更好点
   ========================================================================== */
/* ---------- 触屏：去掉悬停位移（避免点完粘住高亮） ---------- */
@media (hover: none) {
    .res-card:hover { transform: none; box-shadow: var(--shadow); }
    .res-card:hover .card-cover,
    .res-card:hover .card-cover.ph { transform: none; }
    .cat-pill:hover, .sub-pill:hover, .stat-card:hover, .btn:hover { transform: none; }
    .list-clean .list-group-item:hover { padding-left: 1.2rem; }
    .cover-mask { display: none; }
}
a, button, .cat-pill, .sub-pill, .pan-btn { -webkit-tap-highlight-color: transparent; }

/* ---------- 平板 ---------- */
/* ---------- 手机 / 平板：侧边栏收起，汉堡展开 ---------- */
@media (max-width: 992px) {
    .search-wrap { max-width: none; }
    .cover-wrap { height: auto; aspect-ratio: 3 / 4; }
    /* 侧边栏默认隐藏 */
    .topbar { margin-left: 0; padding: .5rem 0; flex-wrap: wrap; }
    .topbar > * { margin-left: 6px; margin-right: 6px; }
    .menu-btn { display: block; }
    .sidebar { transform: translateX(-100%); width: 252px; box-shadow: 6px 0 30px rgba(31, 35, 48, .2); }
    .sidebar.open { transform: translateX(0); }
    .side-close { display: block; }
    .content { margin-left: 0; }
    .topbar .brand { font-size: 1rem; }
    .brand-center { position: static; flex: 1 1 auto; transform: none; text-align: center; z-index: auto; font-size: 1rem; letter-spacing: 1px; }
    /* 手机端：搜索框收起为图标，顶栏只占一行 */
    .search-toggle {
        display: inline-flex; align-items: center; justify-content: center;
        width: 34px; height: 34px; border: none; border-radius: 9px;
        background: rgba(255, 255, 255, .18); color: #fff; font-size: 1rem;
        cursor: pointer; flex: none;
    }
    .search-toggle:active { background: rgba(255, 255, 255, .32); }
    .brand-gear { margin-left: auto; }
    .search-wrap { display: none; flex: 1 1 100%; max-width: 100%; order: 5; margin: 6px 0 0; }
    .search-wrap.show { display: block; }
    .search-wrap .form-control { padding: .45rem 1rem; font-size: .88rem; }
}

/* ---------- 手机 ---------- */
@media (max-width: 768px) {
    body { font-size: 14px; line-height: 1.6; }
    .container, .navbar > .container { padding-left: 12px; padding-right: 12px; }
    main.container { margin-top: 1rem !important; margin-bottom: 1.5rem !important; }

    /* 导航：品牌一行，搜索框独占第二行 */
    .main-nav { padding: .5rem 0; }
    .main-nav > .container { flex-wrap: wrap; row-gap: 8px; }
    .main-nav .navbar-brand { font-size: 1rem; letter-spacing: .3px; }
    .search-wrap { order: 3; flex: 1 1 100%; max-width: 100%; margin: 2px 0 0; }
    .search-wrap .form-control { padding: .45rem 1rem; font-size: .88rem; }
    .main-nav .btn { padding: .3rem .7rem; font-size: .78rem; margin-left: auto !important; }

    /* 分类行：改为横向滑动，不占多行 */
    .cat-row, .sub-row, .pan-row {
        flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
        scrollbar-width: none; padding-bottom: 2px;
    }
    .cat-row::-webkit-scrollbar, .sub-row::-webkit-scrollbar,
    .pan-row::-webkit-scrollbar { display: none; }
    .cat-pill, .sub-pill, .pan-pill, .pan-label { flex: 0 0 auto; white-space: nowrap; }
    .cat-pill { padding: .42rem 1rem; font-size: .86rem; }
    .sub-pill { padding: .3rem .8rem; font-size: .82rem; }
    .sub-row-3 .sub-pill.sm { padding: .26rem .7rem; font-size: .78rem; }
    .cat-row { gap: 8px; margin-bottom: 10px; }
    .sub-row { gap: 6px; margin-bottom: 9px; }

    /* 卡片：一行 3 个，封面竖版海报比例，整体更紧凑 */
    .res-card { border-radius: 11px; }
    .cover-wrap { height: auto; aspect-ratio: 2 / 3; }
    .cover-wrap .card-cover, .cover-wrap .card-cover.ph { height: 100%; width: 100%; }
    .card-cover.ph .ph-text { font-size: .88rem; letter-spacing: .5px; }
    .card-cover.ph .ph-sub { font-size: .52rem; letter-spacing: 1.5px; }
    .card-body { padding: .32rem .42rem .38rem; }
    /* 片名：允许换行完整显示，最多两行（与参考布局一致） */
    .card-title {
        font-size: .74rem; line-height: 1.3; margin: 0; font-weight: 600;
        white-space: normal; overflow: hidden; text-overflow: clip;
        display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
        min-height: 1.95rem;
    }
    .card-code { font-size: .7rem; padding: .25rem .45rem; margin-bottom: .45rem; gap: 2px 8px; }
    /* 卡片网格：手机端 3 列，缩小子项间距以控制封面宽度 */
    .row-cols-3 { --bs-gutter-x: .5rem; --bs-gutter-y: .5rem; }
    .row-cols-3 > * > .res-card { margin: 0; }
    .btn-go { font-size: .8rem; padding: .42rem 0; border-radius: 9px; }
    .pan-tag { font-size: .64rem; padding: 2px 7px; top: 6px; left: 6px; }
    .pan-btns { gap: 5px; }
    .pan-btn { font-size: .72rem; padding: .36rem .35rem; min-width: 50px; border-radius: 8px; }
    .pan-btn em { font-size: .6rem; padding: 0 3px; }

    /* 列表模式：路径 + 标题在左，夸克标签在最右 */
    .li-res { padding: .62rem .85rem; gap: 8px; }
    .li-res .fw-medium { font-size: .88rem; line-height: 1.45; }
    .pan-tag.sm { font-size: .64rem; padding: 2px 7px; }

    .empty-state { padding: 42px 0; }
    .empty-state .empty-emoji { font-size: 2.4rem; }

    /* 后台 */
    .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat-card { padding: .8rem .85rem; gap: 10px; border-radius: 13px; }
    .stat-icon { width: 38px; height: 38px; border-radius: 11px; font-size: 1.05rem; }
    .stat-num { font-size: 1.35rem; }
    .stat-label { font-size: .74rem; }
    .admin-card .card-header { font-size: .88rem; padding: .65rem .9rem; }
    .form-label { font-size: .82rem; }
    .form-control, .form-select { font-size: .88rem; padding: .5rem .7rem; border-radius: 9px; }
    .bar-name { width: 72px; font-size: .8rem; }
    .bar-name em { display: none; }
    .pan-chip { font-size: .76rem; padding: 5px 10px; }
    .pan-mini { font-size: .68rem; padding: 2px 5px 2px 7px; }
    .feed-title { max-width: 100%; font-size: .84rem; }
    .feed .list-group-item { padding: .6rem .9rem; }

    /* 二维码区域移动端 */
    .qr-section {
        flex-direction: column;
        text-align: center;
        gap: .8rem;
    }
    .qr-image-wrapper {
        width: 150px;
        height: 150px;
    }
    .qr-info {
        width: 100%;
    }
    .qr-desc {
        margin-bottom: .5rem;
    }
}

/* ---------- 小屏手机 ---------- */
@media (max-width: 400px) {
    body { font-size: 13.5px; }
    .cover-wrap { aspect-ratio: 2 / 3; }   /* 竖版海报，保持一行 3 个 */
    .card-title { font-size: .7rem; }
    .pan-btn { min-width: 44px; font-size: .68rem; }
    .stat-grid { gap: 8px; }
    .stat-num { font-size: 1.2rem; }
    .row-cols-3 > * { flex: 0 0 auto; width: 33.3333%; }   /* 小屏同样一行 3 个 */
}

/* ---------- 主页公告 / 社群入口 ---------- */
.site-announce {
    display: flex; align-items: center; gap: 10px;
    background: linear-gradient(120deg, #fff7e6, #ffe9c7);
    color: #8a5a00; border: 1px solid #ffd591; border-radius: 12px;
    padding: .6rem .9rem; margin-bottom: 1rem; font-size: .92rem;
}
.site-announce .ann-text { flex: 1; }
.site-announce .ann-close {
    border: none; background: transparent; color: #b5791a;
    font-size: 1.2rem; line-height: 1; cursor: pointer; padding: 0 4px;
}
.site-announce .ann-close:hover { color: #8a5a00; }

.site-groups { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 1.2rem; }
.group-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: .55rem 1.1rem; border-radius: 999px; text-decoration: none;
    font-weight: 700; color: #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
}
.group-btn.qq { background: linear-gradient(120deg, #12b7f5, #0a8fd0); }
.group-btn.quark { background: linear-gradient(120deg, #6a5cff, #00c2ff); }
.group-btn:hover { opacity: .92; color: #fff; }

/* 侧边栏里的社群入口（放在分类栏目最下面） */
.side-item.social-item {
    margin-top: 6px; padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, .14);
}

/* 后台全站资源搜索结果 */
.gs-item { padding: .5rem .65rem; border-bottom: 1px solid #f1f2f7; }
.gs-item:last-child { border-bottom: none; }
.gs-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.gs-info { min-width: 0; flex: 1; }
.gs-actions { display: flex; gap: 6px; flex-wrap: wrap; flex: none; }
.gs-move { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: .5rem; padding-top: .5rem; border-top: 1px dashed #eef0f8; }
.gs-move .form-select-sm { width: auto; min-width: 120px; }
.gs-title { font-weight: 600; font-size: .9rem; line-height: 1.3; }

/* ===== 后台"已有资源"按栏目分组 ===== */
.res-group { padding: .25rem .25rem 0; border-bottom: 1px solid #f1f2f7; }
.res-group:last-child { border-bottom: none; }
.res-group-head {
    display: flex; align-items: center; gap: 8px;
    padding: .65rem .85rem .5rem; font-weight: 700; font-size: 1.02rem; color: #2c2f3a;
}
.res-group-head .rg-ico { font-size: 1.15rem; }
.res-group-head .rg-name { flex: 1; }
.rg-num {
    font-size: .78rem; font-weight: 700; background: #eef0f8; color: #6b7080;
    border-radius: 999px; padding: 1px 9px; flex: none;
}
.res-subhead {
    display: flex; align-items: center; gap: 6px;
    padding: .4rem .9rem; font-size: .86rem; font-weight: 600; color: var(--accent, #6a5cff);
    background: linear-gradient(90deg, rgba(106,92,255,.07), rgba(0,194,255,.04));
    border-left: 3px solid var(--accent, #6a5cff);
}
.res-subhead .rg-num.sm { background: rgba(106,92,255,.14); color: #6a5cff; }
/* 二级目录：可点击展开 / 收起 */
.res-subhead { cursor: pointer; user-select: none; transition: filter .15s; }
.res-subhead:hover { filter: brightness(.97); }
.res-subhead .sub-caret {
    display: inline-block; font-size: .78rem; line-height: 1;
    transition: transform .18s ease; transform-origin: center;
}
.res-subhead.collapsed .sub-caret { transform: rotate(-90deg); }
.res-subhead.collapsed + .res-sub-list { display: none; }

/* ===== 后台"已有资源"横向标签页 ===== */
.res-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: .75rem .9rem .55rem; border-bottom: 1px solid #f1f2f7; }
.res-tab {
    display: inline-flex; align-items: center; gap: 6px;
    border: 1px solid #e6e8f2; background: #fafbff; color: #4a4f60;
    padding: .35rem .75rem; border-radius: 999px; font-size: .86rem; font-weight: 600;
    cursor: pointer; transition: all .15s;
}
.res-tab:hover { border-color: #c9cdf5; color: #6a5cff; }
.res-tab.active { background: linear-gradient(120deg,#6a5cff,#00c2ff); border-color: transparent; color: #fff; box-shadow: 0 4px 12px rgba(106,92,255,.25); }
.res-tab .rt-ico { font-size: 1rem; }
.res-tab .rg-num.sm { background: rgba(106,92,255,.14); color: #6a5cff; }
.res-tab.active .rg-num.sm { background: rgba(255,255,255,.28); color: #fff; }
.res-tab-pane { padding: .25rem .25rem 0; }

/* ===== 二级分类行收起状态（点击已激活分类切换） ===== */
#catRows.collapsed { display: none; }

/* ===== 后台"已有资源"移动分类面板 ===== */
.res-move-panel {
    display: flex; flex-wrap: wrap; gap: .4rem; align-items: center;
    margin-top: .55rem; padding-top: .55rem;
    border-top: 1px dashed #e6e8f2;
}

/* ===== 评分角标 ===== */
.rate-badge {
    position: absolute; top: 8px; right: 8px; z-index: 4;
    background: rgba(20, 22, 33, .68); color: #ffd84d;
    font-size: .72rem; font-weight: 700; letter-spacing: .3px;
    padding: 3px 8px; border-radius: 7px;
    backdrop-filter: blur(2px);
    display: inline-flex; align-items: center; gap: 2px;
}
.rt-badge {
    display: inline-block; margin-left: 6px;
    background: linear-gradient(120deg,#ffb700,#ff7e2a); color: #fff;
    font-size: .72rem; font-weight: 700; letter-spacing: .3px;
    padding: 1px 7px; border-radius: 7px; vertical-align: 2px;
}

/* ===== 移动端底部导航栏 ===== */
.bottom-nav {
    display: none;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 80;
    background: #fff;
    border-top: 1px solid #eceefb;
    box-shadow: 0 -4px 20px rgba(31, 35, 48, .06);
    padding-bottom: env(safe-area-inset-bottom, 0);
}
.bottom-nav-inner {
    display: flex; align-items: stretch; justify-content: space-around;
    height: 56px;
}
.bnav-item {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 2px;
    text-decoration: none; color: #8a90a2;
    transition: color .2s;
}
.bnav-item.active, .bnav-item:active { color: var(--accent); }
.bnav-icon { font-size: 1.2rem; line-height: 1; }
.bnav-label { font-size: .7rem; font-weight: 600; }

@media (max-width: 992px) {
    .bottom-nav { display: block; }
    .content { padding-bottom: 60px; }
}

/* ===== 后台入口小齿轮 ===== */
.admin-gear {
    position: fixed;
    right: 12px;
    bottom: 70px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    opacity: .18;
    text-decoration: none;
    z-index: 70;
    transition: opacity .2s;
}
.admin-gear:hover {
    opacity: .6;
}
@media (min-width: 993px) {
    .admin-gear {
        bottom: 16px;
        right: 16px;
    }
}

/* ===== 页面标题 / 面包屑 ===== */
.page-header {
    margin-bottom: 1rem;
}
.page-title {
    font-weight: 800; font-size: 1.2rem;
    background: linear-gradient(120deg, #6a5cff, #00c2ff);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.breadcrumb {
    color: var(--muted); font-size: .82rem;
}

/* ===== 分类横滑条优化 ===== */
.cat-row, .sub-row {
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; padding-bottom: 2px;
}
.cat-row::-webkit-scrollbar, .sub-row::-webkit-scrollbar { display: none; }
.cat-pill, .sub-pill { flex: 0 0 auto; white-space: nowrap; }

/* ===== 求片留言页 ===== */
.wish-intro {
    text-align: center;
    padding: 1.5rem 1rem 1rem;
}
.wish-intro-icon {
    font-size: 2.5rem;
    margin-bottom: .5rem;
}
.wish-intro-title {
    font-weight: 800;
    font-size: 1.15rem;
    margin-bottom: .4rem;
    background: linear-gradient(120deg, #6a5cff, #00c2ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.wish-intro-desc {
    color: var(--muted);
    font-size: .88rem;
    margin-bottom: 0;
}

.wish-form-card, .wish-list-card, .contact-card, .wish-success {
    background: #fff;
    border-radius: 16px;
    padding: 1.1rem;
    box-shadow: 0 2px 12px rgba(31, 35, 48, .06);
    margin-bottom: 1rem;
}
.wish-form-title, .contact-card-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: .9rem;
}

.wish-type-group {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}
.wish-type-item {
    position: relative;
    flex: 1 1 calc(33.333% - .4rem);
    min-width: 0;
    cursor: pointer;
}
.wish-type-item input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.wish-type-item span {
    display: block;
    text-align: center;
    padding: .55rem .4rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 10px;
    font-size: .85rem;
    transition: all .2s;
    background: #fafbff;
}
.wish-type-item input:checked + span {
    border-color: #6a5cff;
    background: #f0edff;
    color: #5a4bd6;
    font-weight: 600;
}

.wish-submit-btn {
    background: linear-gradient(120deg, #6a5cff, #00c2ff);
    border: none;
    font-weight: 700;
    padding: .7rem;
    border-radius: 12px;
    font-size: 1rem;
}
.wish-submit-btn:active {
    transform: scale(.98);
}

.wish-success {
    text-align: center;
    padding: 1.5rem;
}
.wish-success-icon {
    font-size: 3rem;
    margin-bottom: .5rem;
}
.wish-success h5 {
    font-weight: 700;
    margin-bottom: .5rem;
}
.wish-success p {
    color: var(--muted);
    font-size: .9rem;
    margin-bottom: 1rem;
}

/* 联系方式卡片 */
.contact-list {
    display: flex;
    flex-direction: column;
    gap: .6rem;
}
.contact-item {
    display: flex;
    align-items: center;
    gap: .8rem;
    padding: .7rem;
    border: 1px solid #f0f0f5;
    border-radius: 12px;
    background: #fafbff;
    cursor: pointer;
    transition: all .2s;
}
.contact-item:active {
    transform: scale(.98);
    background: #f0edff;
}
.contact-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.contact-info {
    flex: 1;
    min-width: 0;
}
.contact-label {
    font-size: .78rem;
    color: var(--muted);
}
.contact-value {
    font-weight: 700;
    font-size: .95rem;
}
.contact-copy {
    font-size: .75rem;
    color: #6a5cff;
    font-weight: 600;
    flex-shrink: 0;
}

/* 二维码区域 */
.qr-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .5rem;
}
.qr-image-wrapper {
    flex-shrink: 0;
    width: 130px;
    height: 130px;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #e5e7eb;
    background: #fff;
    padding: 4px;
}
.qr-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.qr-info {
    flex: 1;
    min-width: 0;
}
.qr-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: .4rem;
    color: #1f2937;
}
.qr-desc {
    font-size: .82rem;
    color: var(--muted);
    margin-bottom: .6rem;
    line-height: 1.4;
}
.qr-group-id {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .45rem .75rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    cursor: pointer;
    font-size: .85rem;
    color: #2563eb;
    font-weight: 600;
    transition: all .2s;
}
.qr-group-id:active {
    transform: scale(.97);
    background: #dbeafe;
}
.qr-id-text {
    font-family: monospace;
}
.qr-copy-btn {
    font-size: .72rem;
    background: #2563eb;
    color: #fff;
    padding: .15rem .45rem;
    border-radius: 4px;
    font-weight: 500;
}

/* 留言列表 */
.wish-item {
    padding: .8rem;
    border: 1px solid #f0f0f5;
    border-radius: 12px;
    margin-bottom: .6rem;
    background: #fafbff;
}
.wish-item:last-child {
    margin-bottom: 0;
}
.wish-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .4rem;
}
.wish-type-badge {
    font-size: .75rem;
    font-weight: 600;
    color: #6a5cff;
    background: #f0edff;
    padding: .15rem .55rem;
    border-radius: 999px;
}
.wish-status-badge {
    font-size: .7rem;
    font-weight: 600;
    padding: .15rem .55rem;
    border-radius: 999px;
}
.wish-item-title {
    font-weight: 700;
    font-size: .95rem;
    margin-bottom: .25rem;
    color: var(--text);
}
.wish-item-remark {
    font-size: .82rem;
    color: var(--muted);
    margin-bottom: .4rem;
    padding: .35rem .5rem;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #f0f0f5;
}
.wish-item-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: .75rem;
    color: #94a3b8;
}

/* 复制提示 Toast */
.copy-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(.8);
    background: rgba(0, 0, 0, .8);
    color: #fff;
    padding: .6rem 1.2rem;
    border-radius: 10px;
    font-size: .9rem;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: all .25s;
}
.copy-toast.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* ===== 详情页 ===== */
.detail-page {
    max-width: 100%;
    padding: 0;
}

/* 顶部操作栏：返回 + 打开网盘 一左一右 */
.detail-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .8rem;
    padding: .8rem 1rem;
    position: sticky;
    top: 56px;
    z-index: 50;
    background: rgba(255, 255, 255, .95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #f0f0f5;
    margin: 0 -1rem 1rem;
}
.detail-back-btn {
    color: #6a5cff;
    text-decoration: none;
    font-weight: 600;
    font-size: .9rem;
    padding: .3rem 0;
}
.detail-back-btn:active {
    opacity: .7;
}
.detail-open-btn {
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: .9rem;
    padding: .5rem 1.1rem;
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(106, 92, 255, .3);
    transition: all .2s;
    flex-shrink: 0;
}
.detail-open-btn:active {
    transform: scale(.95);
    box-shadow: 0 2px 6px rgba(106, 92, 255, .3);
}

/* 封面 */
.detail-cover-wrap {
    display: flex;
    justify-content: center;
    padding: .5rem 1rem 1rem;
}
.detail-cover {
    width: 50%;
    max-width: 200px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(31, 35, 48, .18);
}
.detail-cover-ph {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 2px;
}

/* 主体信息 */
.detail-main {
    text-align: center;
    padding: 0 1rem 1rem;
}
.detail-title {
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: .5rem;
    color: var(--text);
}
.detail-meta {
    font-size: .8rem;
    color: var(--muted);
    margin-bottom: .8rem;
}
.detail-pan-info {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: .8rem;
}
.detail-passcode {
    font-size: .85rem;
    color: #64748b;
}
.detail-passcode b {
    color: #334155;
    font-weight: 700;
}

/* 其他网盘 */
.detail-other-links {
    margin-top: .8rem;
    padding-top: .8rem;
    border-top: 1px solid #f0f0f5;
}
.detail-other-links .pan-btns {
    margin-top: .5rem;
    justify-content: center;
}

/* 简介和演员 */
.detail-desc, .detail-actors {
    padding: 0 1rem;
    margin-bottom: 1rem;
    text-align: left;
}
.detail-desc h6, .detail-actors h6 {
    font-weight: 700;
    font-size: .95rem;
    margin-bottom: .5rem;
    padding-left: .5rem;
    border-left: 3px solid #6a5cff;
}
.detail-desc p {
    font-size: .88rem;
    line-height: 1.8;
    color: #475569;
    margin-bottom: 0;
}
.detail-actors p {
    font-size: .88rem;
    color: #475569;
    margin-bottom: 0;
    word-break: break-all;
}
