/* Professional Institutional Design - Data Portal Style */

@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@300;400;600;700&family=Noto+Sans+SC:wght@400;500;700&display=swap');

:root {
    --primary: #0068B3;
    --primary-dark: #004F8C;
    --primary-light: #e8f3fb;
    --primary-mid: #1a7cc5;
    --accent: #F5A623;
    --accent-green: #27ae60;
    --txt-main: #2c3442;
    --txt-sub: #5a6880;
    --txt-muted: #8a96a8;
    --bg-page: #f0f3f7;
    --bg-card: #ffffff;
    --bg-row: #f8fafc;
    --bd-color: #d8e2ed;
    --bd-light: #eaeff5;
    --shd-sm: 0 1px 3px rgba(0, 60, 110, 0.08);
    --shd-md: 0 3px 12px rgba(0, 60, 110, 0.12);
    --shd-lg: 0 6px 24px rgba(0, 60, 110, 0.15);
    --r-base: 4px;
    --r-sm: 3px;
    --r-lg: 8px;
    --ease: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    --topbar-h: 52px;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Source Sans 3', 'Noto Sans SC', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg-page);
    color: var(--txt-main);
    line-height: 1.55;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

/* ========== SITE HEADER ========== */
.site-header {
    background: var(--bg-card);
    border-bottom: 3px solid var(--primary);
    padding: 0.65rem 0;
    box-shadow: var(--shd-sm);
    /* NOT sticky / NOT fixed */
}

.hd-inner {
    display: flex;
    justify-content: center;
    align-items: center;
}

.brand-wrap {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.brand-logo {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: var(--ease);
}

.brand-logo:hover {
    opacity: 0.88;
}

.brand-logo::before {
    content: '';
    display: inline-block;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 6px;
    flex-shrink: 0;
}

.brand-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-dark);
    letter-spacing: 0.3px;
    font-family: 'Source Sans 3', sans-serif;
}

.domain-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    background: var(--primary-light);
    border: 1.5px solid var(--primary);
    border-radius: 3px;
    font-size: 13px;
}

.domain-tag {
    font-weight: 600;
    color: var(--primary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.domain-val {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-dark);
    font-family: 'Courier New', monospace;
}

/* ========== CONTAINER ========== */
.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 16px;
}

.content {
    padding: 14px 0;
}

/* ========== BANNER AD AREA ========== */
.banner-ad-wrap {
    overflow: hidden;
}

/* ========== CATEGORY NAVIGATION ========== */
.category-nav {
    background: var(--bg-card);
    border: 1px solid var(--bd-color);
    border-radius: var(--r-base);
    overflow: hidden;
    margin-bottom: 14px;
    box-shadow: var(--shd-sm);
}

.cat-row {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--bd-light);
}

.cat-row:last-child {
    border-bottom: none;
}

.cat-label {
    font-weight: 700;
    font-size: 12px;
    color: var(--bg-card);
    background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
    white-space: nowrap;
    width: 10%;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 6px;
    flex-shrink: 0;
    letter-spacing: 0.5px;
}

.cat-links {
    width: 90%;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 8px 10px;
    align-items: center;
    background: var(--bg-row);
}

.cat-links a {
    display: inline-block;
    color: var(--txt-main);
    text-decoration: none;
    padding: 5px 0;
    border-radius: var(--r-sm);
    transition: var(--ease);
    background: var(--bg-card);
    border: 1px solid var(--bd-color);
    white-space: nowrap;
    text-align: center;
    font-size: 13px;
    /* PC: 8 per row filling full width */
    width: calc((100% - 35px) / 8);
    flex-shrink: 0;
    flex-grow: 0;
}

.cat-links a:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: var(--shd-sm);
}

.cat-links a.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary-dark);
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0, 104, 179, 0.3);
}

/* ========== SEARCH BOX ========== */
.search-panel {
    background: var(--bg-card);
    border: 1px solid var(--bd-color);
    border-radius: var(--r-base);
    padding: 12px 14px;
    margin-bottom: 14px;
    box-shadow: var(--shd-sm);
}

.search-panel form {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: nowrap;
}

.search-panel input[type="text"] {
    flex: 1;
    min-width: 160px;
    padding: 9px 13px;
    border: 1.5px solid var(--bd-color);
    border-radius: var(--r-sm);
    background: var(--bg-row);
    color: var(--txt-main);
    font-size: 14px;
    font-family: inherit;
    transition: var(--ease);
    outline: none;
}

.search-panel input[type="text"]:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 104, 179, 0.1);
}

.search-panel input[type="text"]::placeholder {
    color: var(--txt-muted);
}

.search-panel button {
    padding: 9px 16px;
    border: none;
    border-radius: var(--r-sm);
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: var(--ease);
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 0.2px;
}

.search-panel button:hover {
    background: var(--primary-dark);
    box-shadow: var(--shd-md);
}

/* ========== HOT TAG CLOUD ========== */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    list-style: none;
    padding: 11px 14px;
    background: var(--bg-card);
    border-radius: var(--r-base);
    margin-bottom: 14px;
    border: 1px solid var(--bd-color);
    box-shadow: var(--shd-sm);
}

.tag-item {
    padding: 4px 12px;
    background: var(--primary-light);
    border-radius: 2px;
    color: var(--primary);
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: var(--ease);
    border: 1px solid rgba(0, 104, 179, 0.2);
    line-height: 1.6;
}

.tag-item:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary-dark);
}

/* ========== SECTION BLOCKS ========== */
.wb-section {
    margin-bottom: 22px;
}

.wb-section-header {
    margin-bottom: 14px;
    padding-bottom: 9px;
    border-bottom: 2px solid var(--bd-color);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wb-section-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50px;
    height: 2px;
    background: var(--primary);
}

.wb-section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--txt-main);
    letter-spacing: -0.2px;
    margin: 0;
}

.wb-section-title a {
    color: inherit;
    text-decoration: none;
    transition: var(--ease);
}

.wb-section-title a:hover {
    color: var(--primary);
}

/* ========== MEDIA CARD GRID ========== */
.media-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    list-style: none;
    padding: 0;
}

.media-grid li {
    animation: fadeCardIn 0.5s ease backwards;
}

.media-grid li:nth-child(1) { animation-delay: 0.04s; }
.media-grid li:nth-child(2) { animation-delay: 0.08s; }
.media-grid li:nth-child(3) { animation-delay: 0.12s; }
.media-grid li:nth-child(4) { animation-delay: 0.16s; }
.media-grid li:nth-child(5) { animation-delay: 0.20s; }
.media-grid li:nth-child(6) { animation-delay: 0.24s; }
.media-grid li:nth-child(7) { animation-delay: 0.28s; }
.media-grid li:nth-child(8) { animation-delay: 0.32s; }

@keyframes fadeCardIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* cover aspect ratio: 600:350 */
.media-thumb {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: var(--r-sm);
    aspect-ratio: 600 / 350;
    background: var(--bg-row);
    border: 1px solid var(--bd-color);
    box-shadow: var(--shd-sm);
}

.media-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.45s ease;
    display: block;
}

.media-thumb:hover img {
    transform: scale(1.07);
}

.media-thumb:hover {
    box-shadow: var(--shd-md);
    border-color: var(--primary);
}

.media-thumb::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 30, 70, 0.65) 0%, transparent 55%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
    pointer-events: none;
}

.media-thumb:hover::before {
    opacity: 1;
}

.media-caption {
    padding: 8px 0 4px;
}

.media-caption h5 {
    font-size: 13px;
    font-weight: 500;
    color: var(--txt-main);
    line-height: 1.45;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.media-caption h5 a {
    color: inherit;
    text-decoration: none;
    transition: var(--ease);
}

.media-caption h5 a:hover {
    color: var(--primary);
}

/* ========== VIDEO PLAYER AREA ========== */
.video-box {
    background: #000;
    border-radius: var(--r-base);
    overflow: hidden;
    margin-bottom: 14px;
}

.video-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: var(--r-base);
    overflow: hidden;
}

.video-container iframe,
.video-container video,
.video-container embed,
.video-container object {
    width: 100% !important;
    height: 100% !important;
    border: none;
    display: block;
}

/* ========== TORRENT CAPTURE GRID ========== */
.torrent-capture-grid {
    width: 100%;
    margin: 10px 0 4px;
}

.torrent-capture-grid picture,
.torrent-capture-grid picture img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--r-sm);
}

/* ========== DOWNLOAD BUTTONS ========== */
.dl-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px 12px;
    margin: 16px 0;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--bd-color);
    border-radius: var(--r-base);
    box-shadow: var(--shd-sm);
}

.down_btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    border-radius: var(--r-sm);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: var(--ease);
    letter-spacing: 0.3px;
    box-shadow: 0 2px 6px rgba(0, 104, 179, 0.3);
    white-space: nowrap;
}

.down_btn:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #003870 100%);
    box-shadow: var(--shd-md);
    transform: translateY(-1px);
}

/* ========== SHARE SECTION ========== */
.share-section {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--bg-card);
    border: 1px solid var(--bd-color);
    border-radius: var(--r-base);
    margin: 14px 0;
    box-shadow: var(--shd-sm);
    flex-wrap: nowrap;
}

.share-url-display {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-row);
    border: 1px solid var(--bd-light);
    border-radius: var(--r-sm);
    padding: 8px 12px;
    overflow: hidden;
}

.share-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.share-url {
    font-size: 12px;
    color: var(--txt-sub);
    font-family: 'Courier New', monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.share-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 9px 16px;
    background: var(--primary-light);
    color: var(--primary);
    border: 1.5px solid var(--primary);
    border-radius: var(--r-sm);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--ease);
    white-space: nowrap;
    flex-shrink: 0;
}

.share-copy-btn:hover {
    background: var(--primary);
    color: #fff;
}

.share-icon {
    font-size: 15px;
    line-height: 1;
}

/* ========== PAGINATION ========== */
.page_info_div {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 18px 0;
}

.a_page_info,
.page_info_focus {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 14px;
    border-radius: var(--r-sm);
    font-size: 13px;
    font-weight: 500;
    transition: var(--ease);
    min-width: 38px;
    text-align: center;
    text-decoration: none;
}

.a_page_info {
    background: var(--bg-card);
    color: var(--txt-main);
    border: 1px solid var(--bd-color);
}

.a_page_info:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.page_info_focus {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    border: 1px solid var(--primary-dark);
    cursor: default;
}

/* ========== FOOTER ========== */
.site-footer {
    padding: 22px 0;
    text-align: center;
    border-top: 2px solid var(--primary-light);
    margin-top: 28px;
    background: var(--bg-card);
}

.site-footer p {
    margin: 6px 0;
    color: var(--txt-sub);
    font-size: 12px;
}

.site-footer a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--ease);
}

.site-footer a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ========== FRIEND LINKS ========== */
.flink-wrap {
    padding: 12px 14px;
    background: var(--bg-card);
    border-radius: var(--r-base);
    border: 1px solid var(--bd-color);
}

.flink-wrap dl {
    margin: 0;
}

.flink-wrap dd {
    display: inline-block;
    margin: 4px 3px;
}

.flink-wrap a {
    color: var(--primary);
    text-decoration: none;
    font-size: 13px;
    transition: var(--ease);
}

.flink-wrap a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ========== HEADING UTILITIES ========== */
.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* ========== PC THUMBNAIL ALIAS ========== */
/* keep backward compat with old template tags */
.thumbnail2-group { display: none; }

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }

    .site-header {
        padding: 0.55rem 0;
    }

    .brand-wrap {
        gap: 10px;
    }

    .brand-logo::before {
        width: 26px;
        height: 26px;
    }

    .brand-title {
        font-size: 20px;
    }

    .domain-badge {
        padding: 4px 10px;
        gap: 5px;
    }

    .domain-tag {
        font-size: 10px;
    }

    .domain-val {
        font-size: 13px;
    }

    .content {
        padding: 10px 0;
    }

    /* Mobile nav: 区域标签收窄，栏目链接区域扩大，字号提升 */
    .cat-row {
        align-items: stretch;
    }

    .cat-label {
        width: 11%;
        font-size: 10px;
        padding: 8px 2px;
        letter-spacing: 0;
    }

    .cat-links {
        width: 89%;
        gap: 5px;
        padding: 7px 6px;
    }

    .cat-links a {
        /* Mobile: 每行4个，共2行 */
        width: calc((100% - 15px) / 4);
        font-size: 15px;
        padding: 8px 2px;
    }

    .search-panel {
        padding: 10px 12px;
    }

    .search-panel form {
        gap: 6px;
    }

    .search-panel input[type="text"] {
        min-width: 100px;
        padding: 8px 10px;
        font-size: 13px;
    }

    .search-panel button {
        padding: 8px 10px;
        font-size: 12px;
    }

    /* Mobile: 2 per row */
    .media-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .media-caption h5 {
        font-size: 12px;
    }

    .wb-section {
        margin-bottom: 16px;
    }

    .wb-section-title {
        font-size: 16px;
    }

    .tag-cloud {
        padding: 9px 10px;
        gap: 6px;
    }

    .tag-item {
        font-size: 12px;
        padding: 4px 10px;
    }

    .down_btn {
        padding: 9px 18px;
        font-size: 13px;
    }

    .dl-actions {
        padding: 12px 8px;
        gap: 8px;
    }

    .share-section {
        padding: 10px 10px;
        gap: 8px;
    }

    .share-url-display {
        padding: 8px 10px;
    }

    .share-label {
        font-size: 10px;
    }

    .share-url {
        font-size: 11px;
    }

    .share-copy-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    .page_info_div {
        padding: 14px 0;
        gap: 5px;
    }

    .a_page_info,
    .page_info_focus {
        padding: 6px 11px;
        font-size: 12px;
        min-width: 32px;
    }

    .site-footer {
        padding: 18px 0;
        margin-top: 20px;
    }

    .video-container {
        aspect-ratio: 16 / 9;
        max-height: 400px;
    }
}

@media (max-width: 480px) {
    .brand-title {
        font-size: 18px;
    }

    .cat-label {
        width: 12%;
        font-size: 9px;
    }

    .cat-links {
        width: 88%;
        gap: 4px;
        padding: 6px 4px;
    }

    .cat-links a {
        width: calc((100% - 12px) / 4);
        font-size: 14px;
        padding: 7px 1px;
    }

    .media-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .media-caption h5 {
        font-size: 11px;
    }

    .wb-section-title {
        font-size: 15px;
    }

    .search-panel input[type="text"] {
        min-width: 80px;
        padding: 7px 8px;
        font-size: 12px;
    }

    .search-panel button {
        padding: 7px 8px;
        font-size: 11px;
    }

    .down_btn {
        padding: 8px 14px;
        font-size: 12px;
    }

    .dl-actions {
        gap: 6px;
        padding: 10px 6px;
    }

    .video-container {
        max-height: 300px;
    }
}

/* ========== VISIBILITY HELPERS ========== */
.hide_mobile { display: block; }
.hide_pc     { display: block; }

@media (max-width: 768px) {
    .hide_mobile { display: none !important; }
}

@media (min-width: 769px) {
    .hide_pc { display: none !important; }
}

/* ========== LAZY LOAD PLACEHOLDER ========== */
img[data-original] {
    background: var(--bg-row);
}

/* ========== AD AREAS (no margin/padding on ad content) ========== */
.ad-banner-top { }
.ad-floor { }
.ad-js { }