/* TenPortal VideoSite Template — Tencent News inspired */

:root {
    --red-dk:      #c0392b;
    --red:         #e03a2a;
    --red-lt:      #f04030;
    --red-soft:    #fdecea;
    --grad-top:    linear-gradient(135deg, #e8302a 0%, #f06040 40%, #e84860 70%, #d03255 100%);
    --blue:        #1a6ed8;
    --blue-hover:  #1558b0;
    --blue-lt:     #e8f0fb;
    --white:       #ffffff;
    --bg-page:     #f4f4f4;
    --bg-white:    #ffffff;
    --bg-panel:    #f8f8f8;
    --bg-section:  #f0f0f0;
    --txt-main:    #1a1a1a;
    --txt-sub:     #333333;
    --txt-muted:   #888888;
    --txt-blue:    #1a6ed8;
    --border:      #e5e5e5;
    --border-dk:   #cccccc;
    --shadow:      rgba(0,0,0,0.08);
    --shadow-md:   rgba(0,0,0,0.15);
    --rad:         4px;
    --rad-sm:      3px;
    --ease:        all 0.18s ease;
}

*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior:smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', 'SimSun', sans-serif;
    background: var(--bg-page);
    color: var(--txt-main);
    line-height: 1.6;
    font-size: 14px;
    overflow-x: hidden;
}

/* ===== TOPBAR ===== */
.tp-bar {
    background: var(--grad-top);
    padding: 0.6rem 0;
    box-shadow: 0 2px 8px rgba(200,40,30,0.3);
}

.tp-bar-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: nowrap;
}

.tp-logo {
    text-decoration: none;
    font-size: 22px;
    font-weight: 900;
    color: var(--white);
    letter-spacing: 0.5px;
    font-style: normal;
    white-space: nowrap;
    text-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.tp-logo:hover { opacity: 0.88; }

.tp-domain-block {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.32);
    border-radius: var(--rad);
    padding: 5px 14px;
}

.tp-domain-lbl {
    font-size: 11px;
    color: rgba(255,255,255,0.75);
    font-weight: 500;
    white-space: nowrap;
}

.tp-domain-str {
    font-size: 16px;
    font-weight: 800;
    color: var(--white);
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* ===== LAYOUT ===== */
.tp-wrap {
    max-width: 1060px;
    margin: 0 auto;
    padding: 0 14px;
}

.tp-sec { padding: 8px 0; }

/* ===== NAV ===== */
.tp-nav-box {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--rad);
    overflow: hidden;
    margin-bottom: 8px;
    box-shadow: 0 1px 4px var(--shadow);
}

.tp-nav-strip {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--border);
}
.tp-nav-strip:last-child { border-bottom: none; }

.tp-zone-lbl {
    font-size: 13px;
    font-weight: 700;
    color: var(--white);
    background: var(--red);
    white-space: nowrap;
    width: 10%;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 5px;
    flex-shrink: 0;
    border-right: 2px solid var(--red-dk);
}

.tp-zone-cats {
    width: 90%;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 7px 10px;
    align-items: center;
    background: var(--bg-white);
}

.tp-zone-cats a {
    display: inline-block;
    color: var(--txt-sub);
    text-decoration: none;
    padding: 4px 3px;
    border-radius: var(--rad-sm);
    transition: var(--ease);
    background: var(--bg-panel);
    border: 1px solid var(--border);
    white-space: nowrap;
    text-align: center;
    font-size: 13px;
    width: calc((100% - 35px) / 8);
    flex-shrink: 0;
    flex-grow: 0;
}
.tp-zone-cats a:hover {
    background: var(--blue);
    color: var(--white);
    border-color: var(--blue-hover);
}
.tp-zone-cats a.active {
    background: var(--blue);
    color: var(--white);
    border-color: var(--blue-hover);
    font-weight: 600;
}

/* ===== SEARCH ===== */
.tp-search-box {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--rad);
    padding: 10px 12px;
    margin-bottom: 8px;
    box-shadow: 0 1px 4px var(--shadow);
}
.tp-search-box form {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    align-items: center;
}
.tp-search-box input[type="text"] {
    flex: 1;
    min-width: 60px;
    padding: 8px 12px;
    border: 1px solid var(--border-dk);
    border-radius: var(--rad-sm);
    background: var(--bg-panel);
    color: var(--txt-main);
    font-size: 13px;
    outline: none;
    transition: var(--ease);
}
.tp-search-box input[type="text"]:focus {
    border-color: var(--blue);
    background: var(--white);
    box-shadow: 0 0 0 2px rgba(26,110,216,0.15);
}
.tp-search-box input[type="text"]::placeholder { color: var(--txt-muted); }
.tp-search-box button {
    padding: 8px 14px;
    border: none;
    border-radius: var(--rad-sm);
    background: var(--blue);
    color: var(--white);
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    transition: var(--ease);
    white-space: nowrap;
    flex-shrink: 0;
}
.tp-search-box button:hover { background: var(--blue-hover); }

/* ===== TAG CLOUDS ===== */
.tp-tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    list-style: none;
    padding: 8px 12px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--rad);
    margin-bottom: 8px;
    border-left: 3px solid var(--red);
    box-shadow: 0 1px 4px var(--shadow);
}
.tp-tag-item {
    padding: 3px 11px;
    background: var(--bg-panel);
    border-radius: var(--rad-sm);
    color: var(--txt-sub);
    text-decoration: none;
    font-size: 12px;
    border: 1px solid var(--border);
    transition: var(--ease);
}
.tp-tag-item:hover {
    background: var(--blue);
    color: var(--white);
    border-color: var(--blue-hover);
}

/* ===== SECTION BLOCK ===== */
.tp-block { margin-bottom: 14px; }

.tp-block-hd {
    display: flex;
    align-items: center;
    padding-bottom: 7px;
    margin-bottom: 10px;
    border-bottom: 2px solid var(--border);
    position: relative;
}
.tp-block-hd::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--red);
}

.tp-block-ttl {
    font-size: 16px;
    font-weight: 700;
    color: var(--txt-main);
    margin: 0;
    letter-spacing: 0.2px;
}
.tp-block-ttl a { color: inherit; text-decoration: none; }
.tp-block-ttl a:hover { color: var(--red); }

/* ===== CARD GRID ===== */
.tp-item-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    list-style: none;
    padding: 0;
}
.tp-item-grid li { animation: tpFadeUp 0.35s ease backwards; }
.tp-item-grid li:nth-child(1){animation-delay:0.03s}
.tp-item-grid li:nth-child(2){animation-delay:0.06s}
.tp-item-grid li:nth-child(3){animation-delay:0.09s}
.tp-item-grid li:nth-child(4){animation-delay:0.12s}
.tp-item-grid li:nth-child(5){animation-delay:0.15s}
.tp-item-grid li:nth-child(6){animation-delay:0.18s}
.tp-item-grid li:nth-child(7){animation-delay:0.21s}
.tp-item-grid li:nth-child(8){animation-delay:0.24s}

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

.tp-thumb {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: var(--rad);
    aspect-ratio: 600 / 350;
    background: var(--bg-section);
    border: 1px solid var(--border);
    box-shadow: 0 1px 4px var(--shadow);
}
.tp-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.38s ease;
    display: block;
}
.tp-thumb:hover { box-shadow: 0 4px 14px var(--shadow-md); }
.tp-thumb:hover img { transform: scale(1.05); }
.tp-thumb::after {
    content: '▶';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.95);
    font-size: 24px;
    background: rgba(0,0,0,0.28);
    border-radius: var(--rad);
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 1;
}
.tp-thumb:hover::after { opacity: 1; }

.tp-item-cap { padding: 6px 0 0; }
.tp-item-cap h5 {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.45;
    color: var(--txt-sub);
}
.tp-item-cap h5 a {
    color: inherit;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: var(--ease);
}
.tp-item-cap h5 a:hover { color: var(--blue); }

/* ===== PLAYER ===== */
.MacPlayer {
    background: #000;
    border-radius: var(--rad);
    overflow: hidden;
    margin-bottom: 10px;
    box-shadow: 0 3px 14px var(--shadow-md);
}

/* ===== DETAIL TITLE ===== */
.tp-detail-ttl {
    line-height: 1.6;
    text-align: center;
    padding: 12px 18px;
    font-size: 15px;
    font-weight: 600;
    margin: 10px 0;
    word-break: break-all;
    background: var(--bg-white);
    border-radius: var(--rad);
    border: 1px solid var(--border);
    border-top: 3px solid var(--red);
    box-shadow: 0 1px 4px var(--shadow);
    color: var(--txt-main);
}

/* ===== TORRENT INFO ===== */
.tp-info-panel {
    font-size: 14px;
    line-height: 1.9;
    padding: 16px 18px;
    background: var(--bg-white);
    border-radius: var(--rad);
    border: 1px solid var(--border);
    border-top: 3px solid var(--red);
    margin: 8px 0;
    color: var(--txt-main);
    box-shadow: 0 1px 4px var(--shadow);
}
.tp-preview-wrap { width: 100%; margin-top: 8px; }
.tp-preview-wrap picture { display: block; width: 100%; }
.tp-preview-wrap img {
    width: 100%;
    height: auto;
    border-radius: var(--rad-sm);
    border: 1px solid var(--border);
    display: block;
}

/* ===== ACTION BUTTONS ===== */
.tp-btn-line {
    text-align: center;
    padding: 12px;
    background: var(--bg-white);
    border-radius: var(--rad);
    margin: 8px 0;
    border: 1px solid var(--border);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    gap: 10px;
    box-shadow: 0 1px 4px var(--shadow);
}
.down_btn {
    display: inline-block;
    padding: 9px 22px;
    background: var(--blue);
    color: var(--white);
    text-decoration: none;
    border-radius: var(--rad-sm);
    font-weight: 700;
    font-size: 13px;
    transition: var(--ease);
    border: none;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}
.down_btn:hover {
    background: var(--blue-hover);
    box-shadow: 0 3px 10px rgba(26,110,216,0.3);
    transform: translateY(-1px);
}

/* ===== SHARE ===== */
.tp-share-row {
    background: var(--bg-white);
    border-radius: var(--rad);
    padding: 10px 14px;
    margin: 8px 0;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 1px 4px var(--shadow);
}
.share-url-display {
    background: var(--bg-panel);
    border: 1px solid var(--border-dk);
    border-radius: var(--rad-sm);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}
.share-label {
    font-weight: 700;
    font-size: 12px;
    color: var(--txt-sub);
    white-space: nowrap;
    flex-shrink: 0;
}
.share-url {
    font-size: 11px;
    color: var(--txt-muted);
    word-break: break-all;
    flex: 1;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
}
.share-copy-btn {
    padding: 8px 16px;
    background: var(--red);
    color: var(--white);
    border: none;
    border-radius: var(--rad-sm);
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    transition: var(--ease);
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    flex-shrink: 0;
}
.share-copy-btn:hover { background: var(--red-dk); }
.share-icon { font-size: 14px; }

/* ===== PAGINATION ===== */
.page_info_div {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    padding: 14px 0;
}
.a_page_info,
.page_info_focus {
    display: inline-block;
    padding: 6px 12px;
    border-radius: var(--rad-sm);
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: var(--ease);
    min-width: 34px;
    text-align: center;
}
.a_page_info {
    background: var(--bg-white);
    color: var(--txt-sub);
    border: 1px solid var(--border-dk);
}
.a_page_info:hover {
    background: var(--blue);
    border-color: var(--blue-hover);
    color: var(--white);
}
.page_info_focus {
    background: var(--red);
    color: var(--white);
    border: 1px solid var(--red-dk);
    cursor: default;
}

/* ===== FRIEND LINKS ===== */
.tp-flink-panel {
    padding: 10px 12px;
    background: var(--bg-white);
    border-radius: var(--rad);
    border: 1px solid var(--border);
    box-shadow: 0 1px 4px var(--shadow);
}
.tp-flink-panel dl { margin: 0; }
.tp-flink-panel dd { display: inline-block; margin: 3px; }
.tp-flink-panel a { color: var(--blue); text-decoration: none; font-size: 13px; }
.tp-flink-panel a:hover { color: var(--red); text-decoration: underline; }

/* ===== FOOTER ===== */
.tp-footer {
    padding: 16px 0;
    text-align: center;
    border-top: 1px solid var(--border);
    margin-top: 14px;
    background: var(--bg-white);
}
.tp-footer p { margin: 4px 0; color: var(--txt-muted); font-size: 12px; }
.tp-footer a { color: var(--txt-muted); text-decoration: none; }
.tp-footer a:hover { color: var(--red); }

/* ===== UTILITIES ===== */
.hide_mobile { display: block; }
.hide_pc     { display: block; }
@media (min-width: 769px) { .hide_pc { display: none !important; } }
.clearfix::after { content:''; display:table; clear:both; }
img[data-original] { background: var(--bg-section); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .tp-wrap { padding: 0 8px; }
    .tp-sec  { padding: 6px 0; }
    .tp-bar  { padding: 0.4rem 0; }
    .tp-bar-inner { gap: 10px; }
    .tp-logo { font-size: 17px; }
    .tp-domain-str { font-size: 13px; }
    .tp-domain-lbl { font-size: 10px; }

    /* Nav: zone 15%, links 85%, 4-per-row, min 12px */
    .tp-zone-lbl  { width:15%; font-size:10px; padding:6px 2px; }
    .tp-zone-cats { width:85%; gap:3px; padding:6px 4px; }
    .tp-zone-cats a {
        font-size: 12px;
        padding: 4px 1px;
        width: calc((100% - 9px) / 4);
        flex-shrink: 0;
        flex-grow: 0;
    }

    /* Search one row, no wrap */
    .tp-search-box form { flex-wrap: nowrap; }
    .tp-search-box input[type="text"] { min-width:60px; padding:7px 8px; font-size:12px; }
    .tp-search-box button { padding:7px 9px; font-size:11px; }

    /* Cards 2-per-row */
    .tp-item-grid { grid-template-columns:repeat(2,1fr); gap:8px; }

    .tp-item-cap h5 { font-size:11px; }
    .tp-block-ttl   { font-size:14px; }
    .tp-block       { margin-bottom:10px; }

    .tp-btn-line { padding:9px 6px; gap:6px; }
    .down_btn    { padding:8px 14px; font-size:12px; }
    .tp-share-row { padding:9px; flex-wrap:nowrap; }
    .share-url-display { padding:7px 10px; }
    .share-copy-btn { padding:8px 10px; font-size:11px; }

    .hide_mobile { display: none !important; }
}

@media (max-width: 480px) {
    .tp-logo { font-size:15px; }
    .tp-domain-str { font-size:12px; }
    .tp-zone-lbl  { width:15%; font-size:10px; padding:5px 1px; }
    .tp-zone-cats { width:85%; gap:3px; padding:5px 3px; }
    .tp-zone-cats a {
        font-size: 12px;
        padding: 3px 1px;
        width: calc((100% - 9px) / 4);
    }
    .tp-search-box input[type="text"] { padding:6px 7px; font-size:11px; }
    .tp-search-box button { padding:6px 8px; font-size:11px; }
    .tp-item-grid { grid-template-columns:repeat(2,1fr); gap:6px; }
    .down_btn { padding:7px 10px; font-size:11px; }
    .tp-btn-line { gap:4px; }
}
