/* ============================================================================
 * 悟空云搜 · 前台全站样式  home.css
 * 重写版：移动优先(mobile-first) + 设计变量 + clamp() 流体尺寸
 * 覆盖：基础/重置、图标、头部、抽屉、页脚、首页、友链、
 *       列表容器(详情/搜索)、搜索结果、二维码、登录注册弹窗、layui 适配
 * 依赖：layui-v2.5.6（.layui-hide / 表单 / layer），easy-home.js（弹窗/复制/抽屉）
 *       主题色变量在 layout/default.html 内联 :root 定义，这里带兜底值
 * ============================================================================ */

/* ---------------------------------------------------------------------------
 * 1. 设计令牌
 * ------------------------------------------------------------------------ */
:root {
    /* 主题色（与内联 :root 保持一致，此处为兜底） */
    --theme-color: #3e3e3e;
    --theme-theme: #399cf5;
    --theme-theme-dark: #2a86d4;
    --theme-background: #fafafa;
    --theme-other_background: #ffffff;

    /* 中性色 */
    --c-line: #e6e6e6;
    --c-line-dash: #ececec;
    --c-muted: #999;
    --c-soft: #666;
    --c-faint: #c4c7ce;

    /* 榜单序号色 */
    --c-rank-1: #fe2d46;
    --c-rank-2: #ff6600;
    --c-rank-3: #faa90e;

    /* 圆角 */
    --radius-lg: 12px;
    --radius: 8px;
    --radius-sm: 4px;
    --pill: 999px;

    /* 阴影 */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-card: 0 2px 15px rgba(0, 0, 0, 0.08);
    --shadow-soft: 0 4px 10px rgba(225, 225, 225, 0.5);

    /* 尺寸 */
    --header-h: 56px;
    --container: 1200px;
    --gap: 20px;

    /* 流体字号 */
    --fs-base: clamp(15px, 3.6vw, 16px);
    --fs-sm: clamp(13px, 3.2vw, 14px);
    --fs-xs: clamp(12px, 3vw, 13px);
    --fs-title: clamp(18px, 5vw, 20px);
    --fs-hero: clamp(22px, 6.4vw, 30px);

    /* 字体族 */
    --font-sans: v-sans, system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif,
        "Apple Color Emoji", "Segoe UI Emoji";
}

/* ---------------------------------------------------------------------------
 * 2. 重置与基础
 * ------------------------------------------------------------------------ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    font-size: var(--fs-base);
    line-height: 1.6;
    color: var(--theme-color);
    background-color: var(--theme-background);
    word-wrap: break-word;
    overflow-wrap: break-word;
    -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3,
h4,
p {
    margin: 0;
}

ul,
ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

a {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease;
}

img {
    max-width: 100%;
    vertical-align: middle;
    border: 0;
}

input,
button,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    margin: 0;
    padding: 0;
    border: 0;
    outline: 0;
    resize: none;
    background: none;
}

button {
    cursor: pointer;
    background: none;
    border: 0;
}

/* 内容区媒体不撑破容器（限定在 main-content，避免影响头部 logo / 二维码固定尺寸） */
.main-content img,
.main-content video,
.main-content canvas {
    max-width: 100%;
    height: auto;
}

@media (hover: hover) and (pointer: fine) {
    a:hover {
        color: var(--theme-theme);
    }
}

#app {
    position: relative;
    z-index: 9;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1 0 auto;
}

/* 无障碍：仅供屏幕阅读器 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------------------------------------------------------------------------
 * 3. 图标字体（Project id 4485496）
 * ------------------------------------------------------------------------ */
@font-face {
    font-family: "iconfont";
    src: url("../fonts/font_4485496_re46ysj9vba.woff2") format("woff2"),
        url("../fonts/font_4485496_re46ysj9vba.woff") format("woff"),
        url("../fonts/font_4485496_re46ysj9vba.ttf") format("truetype");
    font-display: block;
}

.iconfont {
    font-family: "iconfont" !important;
    font-size: 16px;
    font-style: normal;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.icon-shijian_o:before { content: "\ebb1"; }
.icon-laiyuan1:before { content: "\e619"; }
.icon-laiyuan:before { content: "\e651"; }
.icon-yun_o:before { content: "\ebb3"; }
.icon-fenxiang1:before { content: "\e626"; }
.icon-fangwen:before { content: "\e6d5"; }
.icon-xiala:before { content: "\e65b"; }
.icon-caidan:before { content: "\e65d"; }
.icon-uc:before { content: "\e7cb"; }
.icon-xunlei:before { content: "\ea50"; }
.icon-baiduwangpan:before { content: "\e698"; }
.icon-aliyunpan:before { content: "\e615"; }
.icon-fenlei:before { content: "\e65f"; }
.icon-tiaozhuan:before { content: "\e658"; }
.icon--lianjie:before { content: "\e606"; }
.icon-fenxiang:before { content: "\e65c"; }
.icon-fuzhi:before { content: "\e60f"; }
.icon-date:before { content: "\e611"; }
.icon-kuake:before { content: "\e67d"; }
.icon-sousuo:before { content: "\e623"; }

/* ---------------------------------------------------------------------------
 * 4. 头部（固定顶栏）
 * ------------------------------------------------------------------------ */
.header-box {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-h);
    z-index: 99;
}

.header-kox {
    height: var(--header-h);
    flex: none;
}

.header-box .bg {
    position: absolute;
    inset: 0;
    background-color: var(--theme-other_background);
    box-shadow: 0 3px 5px rgba(214, 214, 214, 0.22);
}

.header-box .container {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: 100%;
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 12px;
}

.header-box .container .logo-box {
    display: inline-flex;
    align-items: center;
    flex: none;
    transition: opacity 0.2s ease;
}

.header-box .container .logo-box .logo {
    height: 36px;
    width: auto;
}

.header-box .container .logo-box .title {
    margin-left: 10px;
    font-size: clamp(17px, 4.6vw, 20px);
    font-weight: bold;
    color: var(--theme-color);
    white-space: nowrap;
}

/* 顶部导航区（PC：提交资源/登录注册/用户下拉；手机：仅汉堡按钮） */
.header-box .container .navs {
    display: flex;
    align-items: center;
    flex: none;
    flex-wrap: nowrap;
}

.header-box .container .navs .item,
.header-box .container .navs a {
    margin: 0 12px;
    cursor: pointer;
    white-space: nowrap;
    font-size: var(--fs-sm);
}

.header-box .container .navs .item:hover {
    color: var(--theme-theme);
}

/* 手机端汉堡按钮：桌面隐藏 */
.header-box .container .navs .mobile-nav-btn,
.header-box .container .navs .iconfont {
    display: none;
    cursor: pointer;
    font-size: 22px;
    color: var(--theme-color);
    padding: 5px;
}

/* PC 端把「提交资源 / 登录 / 注册 / 用户名」这一整块默认都渲染出来；手机端由抽屉承载，
   navs 里除汉堡按钮外全部隐藏 */
.header-box .container .navs .item,
.header-box .container .navs .btns,
.header-box .container .navs .auth-links,
.header-box .container .navs .admin-dropdown {
    display: none;
}

.header-box .container .navs .mobile-nav-btn {
    display: block;
    font-weight: bold;
}

/* 用户下拉（登录态） */
.admin-dropdown {
    position: relative;
    text-align: center;
    width: 120px;
}

.admin-dropdown .username {
    cursor: pointer;
}

.dropdown-menu {
    position: absolute;
    top: 26px;
    left: 0;
    width: 100%;
    min-width: 120px;
    background: var(--theme-other_background);
    box-shadow: var(--shadow-sm);
    border-radius: var(--radius);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
}

.admin-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
}

.dropdown-menu a {
    display: block;
    padding: 8px 3px;
    text-align: center;
    color: var(--theme-color);
}

.dropdown-menu a:hover {
    color: var(--theme-theme);
    background-color: rgba(0, 0, 0, 0.05);
}

/* 顶部搜索胶囊（PC 通用样式，手机端仅 .page-resource 显示，见第 5 节） */
.header-box .container .search {
    position: relative;
    display: none;
    flex: 1 1 0;
    align-items: center;
    height: 40px;
    max-width: 400px;
    margin: 0 15px 0 auto;
    border-radius: var(--pill);
    background-color: var(--theme-background);
    overflow: hidden;
}

.header-box .container .search:after {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid var(--theme-color);
    border-radius: inherit;
    box-shadow: 0 2px 4px var(--theme-theme);
    opacity: 0.06;
    pointer-events: none;
}

.header-box .container .search input {
    position: relative;
    z-index: 1;
    flex: 1 1 0;
    min-width: 0;
    height: 100%;
    padding: 0 12px 0 20px;
    font-size: 15px;
    color: var(--theme-color);
    background: transparent;
}

.header-box .container .search .btn {
    position: relative;
    z-index: 1;
    flex: none;
    width: 50px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--theme-theme);
}

.header-box .container .search .btn .iconfont {
    font-size: 24px;
    font-weight: bold;
    color: var(--theme-theme);
}

/* 手机端(≤767)详情页页内没有搜索框，头部保留一个压缩版搜索胶囊；
   搜索页是 .page-resource_search，不匹配这里，仍走页内 search-list */
@media (max-width: 767.98px) {
    .page-resource .header-box .container .search {
        display: flex;
        max-width: none;
        margin: 0;
        height: 40px;
    }
    .page-resource .header-box .container .search input {
        padding-left: 14px;
        font-size: 14px;
    }
    .page-resource .header-box .container .search .btn {
        width: 44px;
    }
    .page-resource .header-box .container .search .btn .iconfont {
        font-size: 20px;
    }
}

/* ---------------------------------------------------------------------------
 * 5. 移动端导航抽屉 + 遮罩
 *    显隐由 JS 通过 layui-hide(存在=隐藏) 控制，位移/透明由 .active 控制
 * ------------------------------------------------------------------------ */
.mobile-nav-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: min(70vw, 280px);
    min-height: 100%;
    background-color: var(--theme-other_background);
    box-shadow: -3px 0 12px rgba(0, 0, 0, 0.12);
    z-index: 10001;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.mobile-nav-menu.active {
    transform: translateX(0);
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    background-color: var(--theme-theme);
    color: #fff;
}

.menu-title {
    font-size: 16px;
    font-weight: bold;
}

.menu-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    transition: background-color 0.2s ease;
}

.menu-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.mobile-menu-list {
    padding: 0;
}

.menu-item {
    border-bottom: 1px solid #f5f5f5;
}

.menu-item a,
.menu-item .item {
    display: flex;
    align-items: center;
    min-height: 46px;
    padding: 12px 16px;
    color: var(--theme-color);
    font-size: var(--fs-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.menu-item a:hover,
.menu-item .item:hover {
    background-color: #f0f2f5;
    color: var(--theme-theme);
}

/* 遮罩层 */
.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
}

/* 抽屉打开时锁定背景滚动 */
body.menu-open {
    overflow: hidden;
}

/* ---------------------------------------------------------------------------
 * 6. 页脚
 * ------------------------------------------------------------------------ */
.footer-box {
    flex-shrink: 0;
    padding: 24px 16px 18px;
    text-align: center;
    background-color: var(--theme-other_background);
}

.footer-box .container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
}

.footer-box .container p,
.footer-box .container address {
    opacity: 0.78;
    padding: 4px 0;
    font-size: var(--fs-xs);
}

/* address 默认倾斜，用作站点联系人标记时只取语义不取样式；整行字号字重与页脚其他行统一 */
.footer-box .container address {
    font-style: normal;
    font-weight: normal;
}

.footer-box .container a {
    color: var(--theme-theme);
}

/* 页脚联系邮箱只作展示，不套链接主题色，避免在一整段灰色说明文字里跳出来 */
.footer-box .container address a {
    color: inherit;
    font-weight: inherit;
}

/* ---------------------------------------------------------------------------
 * 7. 首页 Hero（index.html .home-box.search-box）
 * ------------------------------------------------------------------------ */
.home-box {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 24px 16px 0;
    text-align: center;
}

.home-box .box {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
}

.home-box .logo-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* width 必须显式 auto：img 上的 width/height 属性只是呈现值（优先级为 0），
   这里只覆盖 height 的话属性 width:300 会残留生效，把 300x257 的 logo 横向拉扁 */
.home-box .logo-box .logo {
    width: auto;
    height: clamp(52px, 13vw, 68px);
    margin: 0 8px;
}

.home-box .logo-box .title {
    margin: 0 8px;
    font-size: var(--fs-hero);
    font-weight: bold;
}

.home-box .sub-title {
    padding: 12px 0;
    opacity: 0.6;
    font-size: var(--fs-sm);
}

/* 大搜索框 */
.search-box .search {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    height: clamp(48px, 13vw, 54px);
    margin: 20px auto 0;
    border-radius: var(--pill);
    background-color: var(--theme-other_background);
    box-shadow: var(--shadow-soft);
}

.search-box .search input {
    flex: 1 1 0;
    min-width: 0;
    height: 100%;
    padding: 0 8px 0 22px;
    font-size: clamp(16px, 4.2vw, 18px);
    color: var(--theme-color);
    background: transparent;
}

.search-box .search .btn {
    flex: none;
    width: 60px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.search-box .search .btn .iconfont,
.search-btn .iconfont {
    font-size: 24px;
    font-weight: bold;
    color: var(--theme-theme);
}

/* 热门搜索标签 */
.hot-search-tags {
    margin-top: 15px;
    text-align: center;
}

.hot-search-title {
    font-size: var(--fs-sm);
    color: var(--c-soft);
    margin-right: 8px;
}

.hot-tag {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 5px 12px;
    margin: 5px 6px;
    font-size: var(--fs-xs);
    color: var(--theme-color);
    background-color: #f0f2f5;
    border-radius: var(--pill);
    cursor: pointer;
    transition: all 0.25s ease;
}

@media (hover: hover) and (pointer: fine) {
    .hot-tag:hover {
        background-color: var(--theme-theme);
        color: #fff;
        transform: translateY(-2px);
        box-shadow: 0 2px 8px rgba(57, 156, 245, 0.3);
    }
}

.hot-tag:active {
    transform: translateY(0);
    opacity: 0.8;
}

/* 首页两栏榜单（今日更新 / 随机推荐） */
.home {
    margin-top: clamp(28px, 8vw, 60px);
    text-align: left;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.home .block {
    flex: 1 1 100%;
    min-width: 0;
    background-color: var(--theme-other_background);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 18px 0 8px;
}

.home .nav {
    display: flex;
    align-items: center;
    font-size: clamp(16px, 4.2vw, 18px);
    font-weight: bold;
    color: var(--theme-color);
    padding: 0 18px 10px;
}

.home .nav img {
    width: 24px;
    height: 24px;
    margin-right: 10px;
}

.home .content {
    min-height: 120px;
}

.home .content .list {
    display: flex;
    flex-wrap: wrap;
    padding: 6px 12px;
}

/* 分隔线画在 li 上而不是 p 上：p 还要做 hover 圆角底块，两者分层才不打架。
   与 .samelist / 侧栏列表沿用同一套 1px dashed var(--c-line-dash) */
.home .content .list .item {
    display: block;
    width: 100%;
    min-width: 0;
    text-align: left;
    border-bottom: 1px dashed var(--c-line-dash);
}

.home .content .list .item p {
    padding: 11px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* 序号定宽 + 右对齐 + 等宽数字：1 位和 2 位序号的标题左边缘才能对齐成一条竖线 */
.home .content .list .item p span {
    display: inline-block;
    width: 1.7em;
    margin-right: 8px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: var(--c-faint);
}

.home .content .list .item:nth-child(1) p span { color: var(--c-rank-1); }
.home .content .list .item:nth-child(2) p span { color: var(--c-rank-2); }
.home .content .list .item:nth-child(3) p span { color: var(--c-rank-3); }

/* 榜单条目由 <a class="item"> 改为 <li class="item"><a>，链接需铺满整行才有完整点击区 */
.home .content .list .item > a,
.list-box .right .list .item > a,
.samelist .item > a {
    display: block;
}

@media (hover: hover) and (pointer: fine) {
    .home .content .list .item:hover p {
        background-color: rgba(57, 156, 245, 0.1);
        color: var(--theme-theme);
    }
    .home .content .list .item:hover p span {
        color: var(--theme-theme);
    }
}

/* ---------------------------------------------------------------------------
 * 8. 友情链接
 * ------------------------------------------------------------------------ */
.friend-links {
    margin: 20px 16px;
    padding: 16px;
    background: var(--theme-other_background);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.friend-links-title {
    display: flex;
    align-items: center;
    font-size: var(--fs-base);
    color: var(--theme-color);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--c-line-dash);
}

.friend-links-title i {
    margin-right: 8px;
    font-style: normal;
}

.friend-links-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.friend-link-item {
    display: inline-block;
    padding: 6px 14px;
    border: 1px solid var(--c-line-dash);
    border-radius: var(--radius-sm);
    color: var(--c-soft);
    font-size: var(--fs-sm);
    transition: all 0.25s ease;
}

@media (hover: hover) and (pointer: fine) {
    .friend-link-item:hover {
        border-color: var(--theme-theme);
        color: var(--theme-theme);
        transform: translateY(-2px);
        box-shadow: 0 2px 8px rgba(57, 156, 245, 0.2);
    }
}

/* ---------------------------------------------------------------------------
 * 9. 列表主容器（详情页 detail.html / 搜索页 search.html .list-box）
 *    移动优先：单列堆叠，侧栏隐藏；桌面(≥992) 变两列
 * ------------------------------------------------------------------------ */
.list-box {
    width: 100%;
    max-width: var(--container);
    margin: 16px auto 40px;
    padding: 0 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: var(--gap);
    min-height: calc(100vh - 220px);
}

.list-box .left {
    flex: 1 1 100%;
    min-width: 0;
}

.list-box .right {
    display: none; /* 侧栏手机端隐藏 */
}

/* 区块标题条：原 .list-box h3，改为类选择器，避免语义化后新加的 h1/h2 被误套 */
.list-box .block-title {
    position: relative;
    padding: 15px 16px;
    font-size: var(--fs-title);
    border-bottom: 1px dashed var(--c-line-dash);
}

.list-box .block-title:after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 20px;
    width: 4px;
    height: 18px;
    background-color: var(--theme-theme);
}

.list-box .block-title span {
    color: var(--theme-theme);
}

/* 面包屑 + 资源详情 共用的外层卡。阴影只画在这一层：
   两块各自带 box-shadow 时，下块上抛的阴影会叠在上块底部，接缝处出现一层约 2% 的灰晕（已像素采样比对） */
.resource-content .resource-card {
    background-color: var(--theme-other_background);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    margin-bottom: var(--gap);
}

/* 资源详情卡片 */
.resource-content .resource-detail,
.resource-content .resource-recommend {
    background-color: var(--theme-other_background);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    margin-bottom: var(--gap);
}

/* 卡内的详情段不再自带卡片外观，否则和外层重复一层圆角+阴影。
   只限定在 .resource-card 内，search.html 的 .resource-detail（无面包屑）仍走上面的完整卡片 */
.resource-card .resource-detail {
    background-color: transparent;
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 0;
}

.resource-content .resource-recommend {
    margin-bottom: 0;
}

/* 详情字段 */
.list-box .details {
    padding: 24px 18px;
}

.details .title {
    text-align: center;
    font-size: var(--fs-title);
    font-weight: bold;
    color: var(--theme-theme);
    margin-bottom: 20px;
}

.details .cat {
    display: flex;
    font-size: var(--fs-base);
    padding: 8px 0;
}

.details .cat .l {
    flex: none;
    width: 84px;
    opacity: 0.5;
}

.details .cat .r {
    flex: 1 1 0;
    min-width: 0;
}

.details .cat .r a {
    color: var(--theme-theme);
    word-break: break-all;
}

.details .cat .r .icon {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-right: 8px;
}

.details .cat .r span {
    vertical-align: middle;
}

/* 详情操作按钮 */
.details .btns {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 24px;
}

.details .btns .btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
    height: 38px;
    padding: 0 16px;
    border-radius: var(--pill);
    background-color: var(--theme-other_background);
    color: var(--theme-color);
    font-size: var(--fs-sm);
    opacity: 0.9;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.details .btns .btn:after {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid var(--theme-color);
    border-radius: inherit;
    box-shadow: 0 2px 4px var(--theme-theme);
    opacity: 0.1;
    pointer-events: none;
}

.details .btns .btn .iconfont {
    font-size: 18px;
    margin-right: 5px;
}

.details .btns .btn.btn-col {
    background-color: var(--theme-theme);
    color: #fff;
}

@media (hover: hover) and (pointer: fine) {
    .details .btns .btn:hover {
        background-color: var(--theme-theme);
        color: #fff;
    }
}

/* 相关资源列表（手机单列 / 桌面两列） */
.list-box .details.samelist-box {
    padding: 6px 18px;
}

.samelist {
    display: flex;
    flex-wrap: wrap;
}

/* 分隔线画在 li 上而不是 p 上：p 还要做 hover 圆角底块，两者分层才不打架。
   虚线与 .block-title / 筛选栏沿用同一套语言；两列时两个 li 紧挨（无 column-gap），
   虚线在列间自动接上，读起来仍是一条整行线 */
.samelist .item {
    width: 100%;
    border-bottom: 1px dashed var(--c-line-dash);
}

.samelist .item p {
    padding: 11px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* 序号定宽 + 右对齐 + 等宽数字：1 位和 2 位序号的标题左边缘才能对齐成一条竖线 */
.samelist .item p span {
    display: inline-block;
    width: 1.7em;
    margin-right: 8px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: var(--c-faint);
}

.samelist .item:nth-child(1) p span { color: var(--c-rank-1); }
.samelist .item:nth-child(2) p span { color: var(--c-rank-2); }
.samelist .item:nth-child(3) p span { color: var(--c-rank-3); }

@media (hover: hover) and (pointer: fine) {
    .samelist .item:hover p {
        background-color: rgba(57, 156, 245, 0.1);
        color: var(--theme-theme);
    }
    .samelist .item:hover p span {
        color: var(--theme-theme);
    }
}

/* 触屏没有 hover，用 :active 给一次按压反馈，避免手机上点了像没反应 */
@media (hover: none) {

    .samelist .item:active p,
    .list-box .right .list .item:active p,
    .home .content .list .item:active p {
        background-color: rgba(57, 156, 245, 0.08);
    }
}

/* 末行收口：单列去掉最后一条的线（首页榜单始终单列，只需 :last-child） */
.samelist .item:last-child,
.list-box .right .list .item:last-child,
.home .content .list .item:last-child {
    border-bottom: none;
}

/* 两列时还要去掉与最后一条同排的倒数第二条。
   总数为奇数时倒数第二条落在上一行右格，必须保留，否则那一行左右线不对称 */
@media (min-width: 992px) {

    .samelist .item:nth-last-child(2):nth-child(odd) {
        border-bottom: none;
    }
}

/* 侧栏模块（桌面右栏内） */
.list-box .right .sidebar-module {
    background-color: var(--theme-other_background);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    margin-bottom: var(--gap);
    overflow: hidden;
}

.list-box .right .nav {
    display: flex;
    align-items: center;
    padding: 16px;
    font-size: var(--fs-title);
    font-weight: bold;
    color: var(--theme-color);
    border-bottom: 1px solid var(--c-line);
}

.list-box .right .nav img {
    width: 22px;
    height: 22px;
    margin-right: 10px;
}

.list-box .right .box {
    padding: 12px;
}

/* 侧栏 box 的 12px 内边距不动：同一个 box 还装着广告图那一块，改它会连带改掉图片留白 */
.list-box .right .list .item {
    display: block;
    width: 100%;
    border-bottom: 1px dashed var(--c-line-dash);
}

.list-box .right .list .item p {
    padding: 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    transition: background-color 0.25s ease, color 0.25s ease;
}

.list-box .right .list .item p span {
    display: inline-block;
    width: 1.7em;
    margin-right: 8px;
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: var(--c-faint);
}

.list-box .right .list .item:nth-child(1) p span { color: var(--c-rank-1); }
.list-box .right .list .item:nth-child(2) p span { color: var(--c-rank-2); }
.list-box .right .list .item:nth-child(3) p span { color: var(--c-rank-3); }

@media (hover: hover) and (pointer: fine) {
    .list-box .right .list .item:hover p {
        background-color: rgba(57, 156, 245, 0.1);
        color: var(--theme-theme);
    }
    .list-box .right .list .item:hover p span {
        color: var(--theme-theme);
    }
}

/* ---------------------------------------------------------------------------
 * 10. 搜索结果页 · 页内搜索条（search.html .search-box.search-list）
 *     手机优先：显示；桌面隐藏（改用顶部导航搜索）
 * ------------------------------------------------------------------------ */
.search-list {
    display: block;
    width: 100%;
    padding: 8px 12px 12px;
    background-color: var(--theme-background);
    position: sticky;
    top: var(--header-h);
    z-index: 9;
}

.search-list .search {
    margin-top: 0;
    height: clamp(44px, 12vw, 52px);
}

.search-list .search input {
    padding-left: 12px;
}

/* 分类下拉触发按钮 */
.search-box .search .select {
    position: relative;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 76px;
    height: 68%;
    padding: 0 12px;
    margin-left: 8px;
    border-radius: var(--pill);
    background-color: var(--theme-background);
    white-space: nowrap;
    cursor: pointer;
    font-size: var(--fs-sm);
}

.search-box .search .select i {
    margin-left: 6px;
    transition: transform 0.3s ease;
}

.search-box .search .select.active i {
    transform: rotate(180deg);
}

/* 分类下拉面板 */
.search-box .search .platform-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 6px;
    padding: 4px 0;
    background-color: var(--theme-other_background);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    z-index: 1000;
    display: none;
}

.search-box .search .platform-links.show {
    display: block;
}

.search-box .search .platform-links .link-item {
    display: block;
    padding: 10px 16px;
    border-bottom: 1px solid var(--c-line-dash);
    transition: all 0.2s ease;
}

.search-box .search .platform-links .link-item:last-child {
    border-bottom: none;
}

.search-box .search .platform-links .link-item.active {
    font-weight: bold;
    color: var(--theme-theme);
    background-color: rgba(57, 156, 245, 0.08);
}

@media (hover: hover) and (pointer: fine) {
    .search-box .search .select:hover {
        color: var(--theme-theme);
    }
    .search-box .search .platform-links .link-item:hover {
        background-color: rgba(57, 156, 245, 0.1);
        color: var(--theme-theme);
        padding-left: 20px;
    }
}

/* ---------------------------------------------------------------------------
 * 11. 筛选栏（.list-box .screen）—— 手机隐藏，桌面(≥992)显示为左列
 * ------------------------------------------------------------------------ */
.list-box .screen {
    display: none;
}

/* ---------------------------------------------------------------------------
 * 12. 搜索结果列表
 * ------------------------------------------------------------------------ */
.list-box .left .list {
    padding: 0 8px;
}

.list-box .left .list .item {
    position: relative;
    display: block;
    padding: 14px 8px;
    border-bottom: 1px dashed var(--c-line-dash);
    transition: background-color 0.25s ease;
}

.list-box .left .list .item:last-child {
    border-bottom: none;
}

@media (hover: hover) and (pointer: fine) {
    .list-box .left .list .item:hover {
        background-color: #f5f7fa;
    }
}

.list-box .left .list .item > p {
    font-size: var(--fs-sm);
    color: var(--c-muted);
    margin-bottom: 6px;
}

.list-box .left .list .item .title {
    display: inline-block;
    font-size: clamp(15px, 4.4vw, 17px);
    font-weight: bold;
    color: var(--theme-theme);
    padding-bottom: 4px;
}

.list-box .left .list .item .type {
    position: relative;
    color: var(--c-muted);
    padding-left: 24px;
    margin-top: 8px;
    font-size: var(--fs-sm);
}

.list-box .left .list .item .type::after {
    content: "\e619";
    position: absolute;
    top: 0;
    left: 0;
    font-family: "iconfont";
    font-size: 18px;
    color: var(--c-faint);
}

.list-box .left .list .item .type.time::after { content: "\ebb1"; }
.list-box .left .list .item .type.cate::after { content: "\e65f"; }

.list-box .left .list .item .type span span {
    color: #ff3f3d;
}

/* 结果操作按钮 */
.list-box .left .list .item .btns {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 18px;
    margin-top: 12px;
}

.list-box .left .list .item .btns .btn {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    font-size: var(--fs-sm);
    color: var(--theme-color);
}

.list-box .left .list .item .btns .btn .iconfont {
    font-size: 18px;
    margin-right: 5px;
    color: var(--theme-theme);
}

.list-box .left .list .item .btns .btn .icon {
    width: 20px;
    margin-right: 5px;
    flex: none;
}

@media (hover: hover) and (pointer: fine) {
    .list-box .left .list .item .btns .btn:hover {
        color: var(--theme-theme);
    }
}

/* 结果列表外层卡片 */
.list-box .ebox {
    background-color: var(--theme-other_background);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 8px 12px;
    margin-bottom: 15px;
}

.qtips {
    text-align: center;
    font-size: var(--fs-sm);
    color: var(--c-muted);
    padding: 20px 0;
}

.qbtn {
    text-align: center;
    padding-top: 10px;
}

.qbtn .btn {
    display: inline-block;
    color: var(--c-muted);
    cursor: pointer;
    font-size: var(--fs-sm);
}

.qloading {
    padding: 20px 0;
}

.loader {
    margin: auto;
    width: fit-content;
    font-weight: bold;
    font-family: monospace;
    font-size: clamp(18px, 5vw, 24px);
    background: radial-gradient(circle closest-side, var(--theme-theme) 94%, #0000) right / calc(200% - 1em) 100%;
    animation: l24 1s infinite alternate linear;
}

.loader::before {
    content: "全网检索中，请稍等...";
    line-height: 1em;
    color: #0000;
    background: inherit;
    background-image: radial-gradient(circle closest-side, #fff 94%, var(--theme-theme));
    -webkit-background-clip: text;
    background-clip: text;
}

@keyframes l24 {
    100% { background-position: left; }
}

/* 分页（<el-pagination> 已不再引入 Element，这里仅保证占位居中不报错） */
.page {
    display: flex;
    padding: 20px 0 15px;
    justify-content: center;
}

/* ---------------------------------------------------------------------------
 * 13. 二维码（详情页资源描述内，仅 ≥768 显示）
 * ------------------------------------------------------------------------ */
.qrcode-pc {
    display: none;
    text-align: center;
    margin: 15px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: var(--radius-sm);
}

.qrcode-pc .qrcode-box {
    width: 150px;
    height: 150px;
    box-sizing: border-box;
    margin: 0 auto;
    padding: 10px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#qrcode {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 128px;
    height: 128px;
    margin: 0 auto;
    line-height: 0;
    font-size: 0;
}

#qrcode canvas,
#qrcode img,
#qrcode svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* ---------------------------------------------------------------------------
 * 14. 登录 / 注册弹窗（default.html 模板，由 easy-home 用 layer 打开）
 * ------------------------------------------------------------------------ */
.modern-login-modal {
    background: #fff;
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.modern-login-container {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 20px 16px;
}

.modern-login-header {
    text-align: center;
    margin-bottom: 22px;
}

.modern-login-header h3 {
    font-size: 22px;
    font-weight: bold;
    color: var(--theme-color);
    margin: 0;
}

.modern-login-form {
    width: 100%;
}

.modern-form-group {
    margin-bottom: 16px;
}

.modern-form-label {
    display: block;
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--theme-color);
    margin-bottom: 8px;
}

.modern-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: var(--radius);
    transition: all 0.3s ease;
}

.modern-input-wrapper:focus-within {
    border-color: var(--theme-theme);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(57, 156, 245, 0.1);
}

.modern-input-wrapper i {
    position: absolute;
    left: 12px;
    font-size: 16px;
    color: #6c757d;
    pointer-events: none;
}

.modern-input {
    width: 100%;
    height: 44px;
    padding: 0 12px 0 36px;
    font-size: var(--fs-sm);
    color: var(--theme-color);
    background: transparent;
    border-radius: var(--radius);
}

.modern-input::placeholder {
    color: #adb5bd;
}

.modern-eye-icon {
    position: absolute;
    right: 12px;
    font-size: 16px;
    color: #6c757d;
    cursor: pointer;
    transition: color 0.3s ease;
}

.modern-eye-icon:hover {
    color: var(--theme-theme);
}

.modern-captcha-group {
    margin-bottom: 15px;
}

.modern-captcha-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
}

.modern-captcha-input {
    flex: 1 1 0;
    min-width: 0;
    height: 44px;
    padding: 0 12px;
    font-size: var(--fs-sm);
    color: var(--theme-color);
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: var(--radius);
    transition: all 0.3s ease;
}

.modern-captcha-input:focus {
    border-color: var(--theme-theme);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(57, 156, 245, 0.1);
}

.modern-captcha-img {
    flex: none;
    width: 100px;
    height: 44px;
    border: 1px solid #e9ecef;
    border-radius: var(--radius);
    cursor: pointer;
    object-fit: cover;
}

.modern-login-options {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    font-size: var(--fs-sm);
}

.modern-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: var(--theme-color);
}

.modern-forgot-password {
    margin-left: auto;
    color: var(--theme-theme);
}

.modern-form-actions {
    margin-bottom: 16px;
}

.modern-btn {
    width: 100%;
    height: 44px;
    font-size: var(--fs-sm);
    font-weight: 500;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modern-btn-primary {
    background: var(--theme-theme);
    color: #fff;
}

.modern-btn-primary:hover {
    background: var(--theme-theme-dark);
    box-shadow: 0 4px 12px rgba(57, 156, 245, 0.3);
    transform: translateY(-1px);
}

.modern-btn-primary:active {
    transform: translateY(0);
}

.modern-login-footer {
    text-align: center;
    font-size: var(--fs-sm);
    color: #6c757d;
}

.modern-switch-register,
.modern-switch-login {
    color: var(--theme-theme);
    font-weight: 500;
}

.modern-switch-register:hover,
.modern-switch-login:hover {
    text-decoration: underline;
}

/* 提交资源 / 登录注册 弹窗里的 layui 表单：覆盖 layui 默认样式
   （原 default.html 内联 <style> 已合并至此，桌面/移动各归一处） */
.layui-form-label {
    width: auto !important;
    min-width: 80px;
}

.layui-form-item .layui-input-block {
    margin-left: 0 !important;
}

@media (max-width: 768px) {
    #resource-modal {
        padding: 10px !important;
    }

    .layui-form-label {
        float: none;
        display: block;
        text-align: left;
        padding: 5px 0;
    }

    .mobile-modal .layui-layer-content {
        overflow-y: auto !important;
    }
}

/* ---------------------------------------------------------------------------
 * 15. 减少动效偏好
 * ------------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ===========================================================================
 * 16. 断点收口（mobile-first，逐级增强）
 *   ≥640 大屏手机/小平板 · ≥768 平板/桌面头部 · ≥992 两列内容
 * ======================================================================== */

/* ≥640px：首页榜单开始两列并排 */
@media (min-width: 640px) {
    .home .block {
        flex: 1 1 calc(50% - 8px);
    }
}

/* ≥768px：头部切换为 PC 形态（内联导航 + 顶部搜索胶囊），隐藏汉堡与页内搜索条 */
@media (min-width: 768px) {
    :root {
        --header-h: 68px;
    }

    .header-box .container {
        padding: 0 20px;
    }

    .header-box .container .logo-box .logo {
        height: 43px;
    }

    /* 顶部搜索：所有非首页都显示完整胶囊（模板已保证 mindex 不输出表单） */
    .header-box .container .search {
        display: flex;
    }

    /* 显示内联导航，隐藏汉堡 */
    .header-box .container .navs .item,
    .header-box .container .navs .btns,
    .header-box .container .navs .auth-links,
    .header-box .container .navs .admin-dropdown {
        display: flex;
    }

    .header-box .container .navs .auth-links {
        display: inline-flex;
    }

    .header-box .container .navs .mobile-nav-btn,
    .mobile-nav-menu,
    .mobile-menu-overlay {
        display: none !important;
    }

    /* 首页榜单两列 */
    .home {
        flex-wrap: wrap;
    }

    .home .block {
        flex: 1 1 calc(50% - 8px);
    }

    /* 详情操作按钮固定宽度居中 */
    .details .btns .btn {
        width: 125px;
        padding: 0;
    }

    /* 二维码在 PC 显示 */
    .qrcode-pc {
        display: block;
    }

    /* 页内搜索条隐藏，改用顶部搜索 */
    .search-list {
        display: none;
    }

    .footer-box {
        padding: 30px 20px 20px;
    }

    .friend-links {
        margin: 24px auto;
        max-width: var(--container);
        padding: 16px 24px;
    }

    .modern-login-container {
        padding: 30px;
    }
}

/* ≥992px：内容区两列（筛选/主内容/侧栏） */
@media (min-width: 992px) {
    .list-box {
        flex-wrap: nowrap;
        padding: 0 20px;
    }

    .list-box .left {
        flex: 1 1 0;
        min-width: 0;
    }

    .list-box .right {
        display: block;
        flex: 0 0 300px;
        width: 300px;
    }

    /* 筛选列：粘性左栏 */
    .list-box .screen {
        display: block;
        flex: 0 0 120px;
        width: 120px;
    }

    .list-box .screen .fixed {
        position: sticky;
        top: calc(var(--header-h) + 16px);
        background-color: #fff;
        box-shadow: var(--shadow-card);
        border-radius: var(--radius-lg);
    }

    .list-box .screen .box {
        padding: 8px 16px;
    }

    .list-box .screen .box a {
        display: block;
        padding: 11px 0;
        border-bottom: 1px dashed var(--c-line-dash);
        font-size: var(--fs-sm);
    }

    .list-box .screen .box a:last-child {
        border-bottom: none;
    }

    .list-box .screen .box a.active {
        font-weight: bold;
        color: var(--theme-theme);
    }

    .samelist .item {
        width: 50%;
    }

    .details .cat .l {
        width: 90px;
    }

    .list-box .details {
        padding: 36px 34px;
    }

    .resource-content .resource-detail {
        padding-top: 0;
    }
}

/* ≥1200px：首页 hero 上下留白更舒展 */
@media (min-width: 1200px) {
    .home-box {
        padding-top: clamp(40px, 8vh, 90px);
    }
}

/* ---------------------------------------------------------------------------
 * 17. 语义化改造补充规则
 *     模板层把 div 换成了 header/main/nav/aside/article/section/dl/time/address
 *     后需要补的行为样式集中在这里，不再回到模板里写内联 style
 * ------------------------------------------------------------------------ */

/* 跳至正文：平时走 .sr-only 隐藏，键盘聚焦时才展开（属性需逐项逆回） */
.skip-link:focus {
    position: fixed;
    top: 12px;
    left: 12px;
    width: auto;
    height: auto;
    margin: 0;
    padding: 8px 16px;
    clip: auto;
    overflow: visible;
    z-index: 10001;
    background-color: var(--theme-color);
    color: #fff;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}

/* 面包屑：充当卡片的表头行，通栏虚线与下面的 .block-title 同一套语言。
   底色/圆角/阴影都由外层 .resource-card 承担，这里再画一层会在接缝处叠出灰晕。
   左内边距取 16px 与 .block-title 对齐，两行文字左边缘才能成一条竖线 */
.breadcrumb {
    padding: 12px 16px;
    font-size: var(--fs-sm);
    line-height: 1.5;
    color: var(--c-soft);
    border-bottom: 1px dashed var(--c-line-dash);
}

/* 不换行：分隔符跟着当前页走，避免它单独掉在上一行行尾 */
.breadcrumb ol {
    display: flex;
    flex-wrap: nowrap;
    align-items: baseline;
    gap: 4px;
}

/* li 只能是块级，不能写 display:flex —— text-overflow 只作用于块容器的行内内容，
   flex 会把文字包成匿名 flex item，省略号失效，长资源名只会被 overflow 硬裁成半个字。
   min-width:0 允许 flex 项收缩到内容宽度以下，省略号才会出现 */
.breadcrumb li {
    display: block;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 首页那一项不参与收缩，保证「悟空云搜 ›」始终完整 */
.breadcrumb li:first-child {
    flex: 0 0 auto;
}

.breadcrumb li + li::before {
    content: "\203A";
    margin: 0 8px;
    color: var(--c-faint);
}

.breadcrumb a {
    color: var(--c-muted);
}

.breadcrumb a:hover {
    color: var(--theme-theme);
}

/* dl 做字段表：浏览器默认的 40px 缩进和外边距都要去掉 */
.details dl,
.details dt,
.details dd {
    margin: 0;
    padding: 0;
}

.details .notice {
    width: 100%;
    margin-top: 16px;
    text-align: center;
    font-size: var(--fs-sm);
    color: var(--c-muted);
}

.qrcode-pc .tip {
    margin-top: 5px;
    font-size: 11px;
    color: #999;
}

/* 搜索页分类下拉的箭头：改成 button 后不再继承原 div 的字号 */
.search-box .search .select .iconfont {
    font-size: 3vw;
}

/* 结果标题包了一层 h2，字重由 a.title 自己控制，避免整行变粗 */
.list-box .left .list .item .item-title {
    font-weight: normal;
}

.qbtn .btn-warn {
    color: #ff3f3d;
}

/* 侧栏推广图：没宽度约束时会按原尺寸 794px 撑破容器 */
.ad-img {
    display: block;
    width: 100%;
    height: auto;
    margin-top: 20px;
    box-sizing: border-box;
}

.layui-form.resource-form {
    padding: 20px;
}

/* 页脚站点导航 */
.footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 16px;
    margin-top: 10px;
    font-size: var(--fs-xs);
}
