/* ============================================
 * pages.css - 页面级样式（从 index/list 内联抽取 + 视觉升级）
 * 包含：卡片封面、海报懒加载、资源标签、提示条、筛选按钮
 * ============================================ */

/* ---------- 首页：卡片封面 ---------- */
.image-container {
    position: relative;
    display: inline-block;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 8px;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    vertical-align: middle;
    transition: transform 0.4s ease;
}

.image-container:hover img {
    transform: scale(1.06);
}

/* 角标 */
.info-tag {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.55);
    -webkit-backdrop-filter: blur(8px) saturate(180%);
    backdrop-filter: blur(8px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    z-index: 10;
    box-sizing: border-box;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.tag-top-left { top: 6px; left: 6px; }
.tag-top-right { top: 6px; right: 6px; }
.tag-bottom-right { bottom: 6px; right: 6px; background-color: rgba(0, 0, 0, 0.65); }

/* 悬停信息层 */
.hover-info {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.6) 100%);
    color: #fff;
    padding: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 15;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
    gap: 4px;
    overflow: hidden;
}

.image-container:hover .hover-info {
    opacity: 1;
}

.hover-desc {
    font-size: 12px;
    margin: 0;
    word-wrap: break-word;
    white-space: normal;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 8;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hover-year {
    font-size: 13px;
    font-weight: bold;
    margin: 0;
    word-wrap: break-word;
    white-space: normal;
}

.hover-category {
    font-size: 12px;
    font-weight: bold;
    margin: 0;
    word-wrap: break-word;
    white-space: normal;
    opacity: 0.9;
}

.hover-info.hidden {
    display: none;
}


/* ---------- 搜索页：海报懒加载（统一 poster / vimg） ---------- */
.poster,
.vimg {
    float: left;
    margin-left: 8px;
    overflow: hidden;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background-color: var(--glass-bg-subtle);
    border: 1px solid var(--glass-border-subtle);
    flex-shrink: 0;
    position: relative;
    opacity: 0;
    transition: opacity 0.3s ease;
    min-height: 20px;
}

.poster.loaded,
.vimg.loaded {
    opacity: 1;
}

.poster img,
.vimg img {
    height: auto;
    max-width: 100px;
    max-height: 200px;
    object-fit: contain;
    transition: opacity 0.3s ease, transform 0.3s ease;
    border-radius: 6px;
    position: relative;
}

.poster.loaded img:hover,
.vimg.loaded img:hover {
    transform: scale(1.04);
}

.poster::before,
.vimg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--glass-bg-subtle);
    z-index: 1;
}

.poster.loaded::before,
.vimg.loaded::before {
    display: none;
}

/* 骨架屏加载动画 */
.poster.loading-lazy,
.vimg.loading-lazy {
    background-color: var(--glass-bg-subtle);
    position: relative;
}

.poster.loading-lazy::before,
.vimg.loading-lazy::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, var(--glass-bg-subtle) 25%, var(--glass-bg-strong) 50%, var(--glass-bg-subtle) 75%);
    background-size: 200% 100%;
    animation: loading-placeholder 1.5s infinite;
    z-index: 1;
}

@keyframes loading-placeholder {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.poster.loading-lazy img,
.vimg.loading-lazy img {
    opacity: 0;
}

.poster.loaded img,
.vimg.loaded img {
    opacity: 1;
}


/* ---------- 搜索页：内容区域 ---------- */
.content-area {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    overflow: hidden;
}

.type {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
}

.type span {
    display: flex;
    align-items: center;
}

.type.cate {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 4.5em;
    line-height: 1.5;
}


/* ---------- 筛选 / 过滤按钮 ---------- */
.filter-btn {
    display: inline-block;
    margin-left: 10px;
    vertical-align: middle;
}

.filter-invalid-btn {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: #fff;
    border: none;
    padding: 7px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.25s ease;
    box-shadow: 0 2px 6px rgba(231, 76, 60, 0.25);
}

.filter-invalid-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(231, 76, 60, 0.35);
}

.filter-invalid-btn:active:not(:disabled) {
    transform: translateY(0);
}

.filter-invalid-btn.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}

.filter-invalid-btn.loading::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-left: 6px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}


/* ---------- 资源来源标签（网盘类型徽章） ---------- */
.source-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 6px;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    margin-right: 5px !important;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    letter-spacing: 0.2px;
}

.source-tag.ali {
    background: linear-gradient(135deg, #007AFF 0%, #5C9EFF 50%, #6666FF 100%);
}

.source-tag.baidu {
    background: linear-gradient(135deg, #2E7DFF 0%, #64B5F6 50%, #1976D2 100%);
}

.source-tag.uc {
    background: linear-gradient(135deg, #FF6A00 0%, #FFB347 50%, #FF8C42 100%);
}

.source-tag.xunlei {
    background: linear-gradient(135deg, #007DFF 0%, #42A5F5 50%, #0056B3 100%);
}

.source-tag.quark {
    background: linear-gradient(135deg, #3370FF 0%, #5C9EFF 50%, #2E65E6 100%);
}


/* ---------- 提取码 ---------- */
.pwd-code {
    background-color: var(--glass-bg-subtle);
    border: 1px solid var(--glass-border-subtle);
    padding: 3px 8px;
    border-radius: 5px;
    font-weight: bold;
    color: #e74c3c;
    cursor: pointer;
    user-select: none;
    font-size: 12px;
    margin-right: 5px !important;
    transition: all 0.2s ease;
}

.pwd-code:hover {
    background-color: var(--glass-bg-strong);
    border-color: var(--glass-border);
}

.pwd-code::before {
    content: "提取码：";
    font-weight: normal;
    color: var(--text-secondary);
}


/* ---------- 来源信息 Tooltip ---------- */
.source-info {
    position: relative;
    display: inline-block;
}

.source-info .tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--glass-bg-strong);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    border: 1px solid var(--glass-border);
    color: var(--theme-color);
    text-align: center;
    padding: 8px 12px;
    border-radius: 6px;
    z-index: 1000;
    min-width: 50px;
    font-size: 12px;
    transition: opacity 0.3s;
    white-space: nowrap;
    box-shadow: var(--shadow-md);
}

.source-info:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

.source-info .tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--glass-border);
}

.source-icon {
    margin-right: 4px;
    font-size: 14px;
    vertical-align: middle;
}


/* ---------- 时间显示 ---------- */
.time-right {
    color: var(--text-secondary);
    font-size: 15px;
    display: inline;
}


/* ---------- 按钮交互 ---------- */
.btn:hover {
    color: var(--theme-theme);
    font-weight: bold;
    transform: scale(1.05);
    transition: all 0.3s ease;
}

.btns .btn {
    margin-right: 8px;
    margin-bottom: 2px;
}

.item {
    display: flex;
    flex-direction: column;
    position: relative;
}

.btns2 {
    z-index: 3;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.btns2.loading-complete {
    opacity: 0.8;
}


/* ---------- 警告提示条 ---------- */
.warning-tip {
    background: linear-gradient(135deg, rgba(255, 245, 245, 0.6) 0%, rgba(255, 235, 238, 0.6) 100%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
    border: 1px solid var(--glass-border);
    border-left: 4px solid #f44336;
    color: #d32f2f;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    line-height: 1.5;
    margin: 10px 0;
    box-shadow: 0 2px 4px rgba(244, 67, 54, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    animation: warningPulse 2s ease-in-out infinite;
    text-align: center;
}

.warning-tip::before {
    font-size: 18px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    height: 100%;
}

.warning-tip:hover {
    background: linear-gradient(135deg, rgba(255, 235, 238, 0.7) 0%, rgba(255, 205, 210, 0.7) 100%);
    box-shadow: 0 3px 6px rgba(244, 67, 54, 0.15);
    transform: translateY(-1px);
    transition: all 0.3s ease;
}

/* 暗黑模式下警告条颜色适配 */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .warning-tip {
        background: linear-gradient(135deg, rgba(244, 67, 54, 0.15) 0%, rgba(244, 67, 54, 0.08) 100%);
        color: #ff8a80;
    }
    :root:not([data-theme="light"]) .warning-tip:hover {
        background: linear-gradient(135deg, rgba(244, 67, 54, 0.2) 0%, rgba(244, 67, 54, 0.12) 100%);
    }
}

:root[data-theme="dark"] .warning-tip {
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.15) 0%, rgba(244, 67, 54, 0.08) 100%);
    color: #ff8a80;
}
:root[data-theme="dark"] .warning-tip:hover {
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.2) 0%, rgba(244, 67, 54, 0.12) 100%);
}

@keyframes warningPulse {
    0%, 100% { box-shadow: 0 2px 4px rgba(244, 67, 54, 0.1); }
    50% { box-shadow: 0 2px 8px rgba(244, 67, 54, 0.2); }
}
