/* 笔试题库列表页 — 左图右文大卡片 */

.pset-page {
    overflow-x: clip;
}

.pset-page .section.transparent {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* 页头：页标题压过下方广告卡，避免两个「题库」标题抢层级 */
.pset-page .pset-page-hero {
    margin-bottom: 12px;
}

.pset-page .head.pset-head-center {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin-bottom: 0;
}

.pset-page .head.pset-head-center > div {
    width: 100%;
    max-width: 640px;
    margin-inline: auto;
}

.pset-page .head-title {
    margin: 0;
    font-size: 42px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: #e8940c;
}

.pset-page .pset-vip-sub {
    font-size: 13px;
    color: #6b7280;
    margin: 10px 0 0;
    line-height: 1.65;
    font-weight: 400;
}

.pset-page .pset-vip-sub a {
    color: #2563eb;
    text-decoration: none;
}

.pset-page .pset-vip-sub a:hover {
    text-decoration: underline;
}

.theme--dark .pset-page .head-title {
    color: #fbbf24;
}

.theme--dark .pset-page .pset-vip-sub {
    color: #9ca3af;
}

.theme--dark .pset-page .pset-vip-sub a {
    color: #60a5fa;
}

.code-media-wrapper {
    width: 100%;
    box-sizing: border-box;
    padding: 0 10px 24px;
}

.code-media-search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.code-media-search-bar input[type="text"] {
    flex: 1;
    min-width: 180px;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #ddd;
    font-size: 0.95em;
    box-sizing: border-box;
    background: #fff;
    color: #111;
    outline: none;
}

.code-media-search-bar input[type="text"]:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.15);
}

.code-media-search-bar .owned-filter {
    display: flex;
    align-items: center;
    font-size: 0.9em;
    color: #444;
    user-select: none;
    cursor: pointer;
}

.code-media-search-bar .owned-filter input[type="checkbox"] {
    margin-right: 6px;
    accent-color: #007bff;
}

.code-node-body {
    min-width: 0;
}

.code-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(max(260px, calc((100% - 50px) / 3)), 1fr));
    gap: 25px;
}

.code-media-tile {
    position: relative;
    display: flex;
    align-items: center;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    cursor: pointer;
    border-radius: 12px;
    background-color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.code-media-tile:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    z-index: 10;
}

.code-media-thumb {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 12px 0 0 12px;
    flex-shrink: 0;
    background: #f2f4f8;
}

.code-media-text {
    padding: 20px;
    flex: 1;
    min-width: 0;
    padding-right: 72px;
}

.code-media-title {
    font-weight: bold;
    font-size: 1.2em;
    color: #111;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 8px;
}

.code-media-desc {
    font-size: 0.9em;
    color: #666;
    height: 3.6em;
    line-height: 1.8;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-clamp: 2;
}

.code-media-badges {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
    pointer-events: none;
}

.code-media-badge {
    background-color: #28a745;
    color: #fff;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: bold;
    white-space: nowrap;
}

.code-media-badge-owned {
    background-color: #007bff;
}

.code-tooltip {
    position: fixed;
    max-width: min(360px, 90vw);
    background: rgba(80, 80, 80, 0.95);
    color: #fff;
    padding: 14px 16px;
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
    font-size: 0.95em;
    line-height: 1.6;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease, visibility 0.15s ease;
}

.code-tooltip .tooltip-title {
    font-weight: 700;
    font-size: 1.05em;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.code-tooltip .tooltip-body {
    font-size: 0.92em;
    color: #eee;
    white-space: normal;
    word-break: break-word;
}

.theme--dark .code-media-tile {
    background: #1e1e1e;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}

.theme--dark .code-media-tile:hover {
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.08);
}

.theme--dark .code-media-title {
    color: #fafafa;
}

.theme--dark .code-media-desc {
    color: #cfcfcf;
}

.theme--dark .code-media-thumb {
    background: #2b2f36;
}

.theme--dark .code-tooltip {
    background: rgba(40, 40, 40, 0.96);
    color: #f2f2f2;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.theme--dark .code-tooltip .tooltip-body {
    color: #dcdcdc;
}

.theme--dark .code-media-search-bar input[type="text"] {
    background: #1a1a1a;
    color: #e6e6e6;
    border: 1px solid #444;
}

.theme--dark .code-media-search-bar input[type="text"]::placeholder {
    color: #777;
}

.theme--dark .owned-filter {
    color: #dcdcdc;
}

.theme--dark .owned-filter input[type="checkbox"] {
    filter: brightness(0.85);
}

@media (max-width: 900px) {
    .code-media-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 18px;
    }
}

@media (max-width: 600px) {
    .pset-page .head-title {
        font-size: 32px;
    }

    .code-media-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .code-media-tile:hover {
        transform: translateY(-3px);
    }
}

@media (max-width: 420px) {
    .code-media-thumb {
        width: 110px;
        height: 110px;
    }

    .code-media-text {
        padding: 14px 16px;
        padding-right: 64px;
    }

    .code-media-title {
        font-size: 1.05em;
    }
}

@media (prefers-reduced-motion: reduce) {
    .code-media-tile {
        transition: box-shadow 0.3s ease;
    }

    .code-media-tile:hover {
        transform: none;
    }
}
