/* ===== HunterCMS 全局样式 ===== */
/* 自适应 PC / 手机：通过 CSS 变量 + 设备检测实现双套字号（不依赖 viewport，布局不受影响） */

/* PC 端：原始字号 */
:root {
    --fs-xs: 11px;      /* 小标签 badge */
    --fs-sm: 12px;      /* IP 列 */
    --fs-meta: 13px;    /* 元数据/简介/盘链接/热搜/提示信息 */
    --fs-body: 14px;    /* 正文/按钮/输入框/表格/导航/toast */
    --fs-nav: 15px;     /* 导航栏 */
    --fs-h3: 16px;      /* 卡片标题 h3 */
    --fs-h2: 18px;      /* 页面标题 h2 */
    --fs-h1: 24px;      /* 调色板主标题 */
    --fs-icon: 48px;    /* 图标 */
}

body {
    margin: 0;
    background: #f5f5f5;
    font-family: sans-serif;
    line-height: 1.5;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 后台左对齐模式 */
.container.container-left {
    margin: 0;
}

/* 卡片通用样式 */
.card {
    box-sizing: border-box;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 20px;
}

/* 卡片容器内卡片布局：前两个各一半，第三个撑满 */
.card-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}
.card-wrap > .card {
    width: 100%;
    margin-bottom: 0;
}
.card-wrap > .card:nth-child(1),
.card-wrap > .card:nth-child(2) {
    flex: 0 0 calc(50% - 10px);
}

/* 表格通用 */
.table-wrap {
    overflow-x: auto;
    margin-bottom: 20px;
}

table {
    border-collapse: collapse;
    width: 100%;
}

th, td {
    border: 1px solid #ccc;
    padding: 6px 10px;
}

th {
    background: #f5f5f5;
    white-space: nowrap;
}

/* 按钮通用 */
button {
    margin-right: 6px;
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 4px;
    border: 1px solid #ccc;
    background: #fff;
}

button.primary {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

/* 分页通用 */
.pagination {
    margin-top: 16px;
    text-align: center;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 6px 12px;
    margin: 0 2px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #007bff;
}

.pagination .current {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

.pagination a:hover {
    background: #e9ecef;
}

/* 输入框通用 */
input, select, textarea {
    box-sizing: border-box;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 8px 12px;
}

/* 行内操作区 */
.top-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

/* 详细资料卡片顶部：左侧字段 + 右侧封面预览 */
.detail-top {
    display: flex;
    gap: 20px;
    margin-bottom: 12px;
}
.detail-fields {
    flex: 1;
    min-width: 0;
}
.cover-preview-wrap {
    position: relative;
    width: 110px;
    height: 150px;
    flex-shrink: 0;
    background: #f0f0f0;
    border-radius: 4px;
    border: 1px solid #ddd;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cover-preview-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.cover-preview-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 6px 14px;
    font-size: 13px;
    background: rgba(0,0,0,0.55);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.9;
    z-index: 1;
    white-space: nowrap;
}
.cover-preview-btn:hover {
    opacity: 1;
    background: rgba(0,0,0,0.7);
}

/* 搜索卡片海报容器 */
.poster-wrap {
    position: relative;
    width: 100px;
    height: 140px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
    background: transparent;
}
.poster-wrap .poster-img {
    width: 100px;
    height: 140px;
    object-fit: cover;
    display: block;
}
.poster-type-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    z-index: 1;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 20px;
    padding: 2px 6px;
    border-radius: 3px;
    line-height: 1.4;
    pointer-events: none;
}
/* PC 端角标缩小 */
@media (hover: hover) and (pointer: fine) {
    .poster-type-badge {
        font-size: 13px;
    }
}

/* 手机端（触摸设备）：放在末尾确保优先级 */
@media (hover: none) and (pointer: coarse) {
    :root {
        --fs-xs: 9px;      /* 小标签 badge */
        --fs-sm: 9px;      /* IP 列 */
        --fs-meta: 15px;   /* 元数据/简介/盘链接/热搜/提示信息 */
        --fs-body: 10px;   /* 正文/按钮/输入框/表格/导航/toast */
        --fs-nav: 10px;    /* 导航栏 */
        --fs-h3: 16px;     /* 卡片标题 h3 */
        --fs-h2: 11px;     /* 页面标题 h2 */
        --fs-h1: 12px;     /* 调色板主标题 */
        --fs-icon: 14px;   /* 图标 */
    }
    .poster-wrap {
        width: 100px;
        height: 140px;
    }
    .poster-wrap .poster-img {
        width: 100px;
        height: 140px;
    }
    .card {
        padding: 8px !important;
        margin-bottom: 8px !important;
    }
    .poster-type-badge {
        font-size: 10px;
        padding: 1px 3px;
        top: 1px;
        left: 1px;
    }
    .actions button {
        font-size: 10px !important;
        padding: 2px 2px !important;
    }
    .report-btn {
        font-size: 10px !important;
        padding: 2px 2px !important;
    }
    #hotTags {
        margin-bottom: 8px !important;
    }
    #hotTags span {
        font-size: 12px !important;
        white-space: nowrap;
        border-radius: 6px !important;
        padding: 0px 4px !important;
    }
    .disk-link {
        padding: 2px 2px !important;
        margin: 1px !important;
        line-height: 1;
        font-size: 12px !important;
    }
    .search-bar:not(#hotTags) {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 4px !important;
        padding: 10px !important;
        margin-bottom: 8px !important;
    }
    .search-bar:not(#hotTags) input#kw {
        flex: 1 !important;
        min-width: 0 !important;
        margin-right: 0 !important;
        font-size: 16px !important;
    }
    .search-bar:not(#hotTags) button.primary {
        font-size: 14px !important;
        padding: 6px 10px !important;
        white-space: nowrap !important;
    }
    .search-bar select {
        flex: 0 0 auto !important;
        width: auto !important;
        max-width: 65px !important;
        min-width: 50px !important;
        font-size: 16px !important;
        padding: 3px 2px !important;
    }
    .card-body h3 {
        margin-bottom: 2px !important;
    }
    .card-body .intro {
        margin: 2px 0 !important;
    }
    .disk-links {
        margin-top: 2px !important;
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 2px !important;
    }
    .actions {
        padding-top: 8px !important;
    }
    .actions button {
        padding: 3px 8px !important;
    }
}

