/* NightStream - Dark Video Website Template */
/* Inspired by: Tencent Video dark theme */

:root {
    --dk-gold: #f5a623;
    --dk-gold-hover: #ffba45;
    --dk-gold-dim: rgba(245,166,35,0.15);
    --dk-bg: #0f0f0f;
    --dk-bg2: #161616;
    --dk-surface: #1c1c1c;
    --dk-surface2: #242424;
    --dk-surface3: #2c2c2c;
    --dk-border: #2e2e2e;
    --dk-border2: #3a3a3a;
    --dk-text: #e8e8e8;
    --dk-text-soft: #b0b0b0;
    --dk-text-muted: #6a6a6a;
    --dk-red: #e03030;
    --shadow-dk: 0 2px 8px rgba(0,0,0,0.4);
    --shadow-dk-md: 0 4px 16px rgba(0,0,0,0.6);
    --rad-lg: 8px;
    --rad-md: 6px;
    --rad-sm: 4px;
    --trs: all 0.2s ease;
    --grad-gold: linear-gradient(135deg, #f5a623 0%, #e8950e 100%);
}

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

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', sans-serif;
    background: var(--dk-bg);
    color: var(--dk-text);
    line-height: 1.55;
    font-size: 14px;
    overflow-x: hidden;
}

/* ===== SITE TOP BAR ===== */
.ns-topbar {
    background: var(--dk-bg2);
    border-bottom: 1px solid var(--dk-border);
    padding: 8px 0;
}

.ns-topbar-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: nowrap;
}

.ns-logo-link {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.ns-site-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--dk-gold);
    letter-spacing: 1px;
    border-bottom: none;
    font-style: normal;
    line-height: 1;
}

.ns-domain-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--dk-gold-dim);
    border: 1px solid rgba(245,166,35,0.35);
    border-radius: var(--rad-sm);
    padding: 4px 12px;
}

.ns-domain-tag {
    font-size: 11px;
    color: var(--dk-gold);
    white-space: nowrap;
    font-weight: 500;
}

.ns-domain-url {
    font-size: 18px;
    font-weight: 700;
    color: var(--dk-gold);
    letter-spacing: 0.4px;
    font-family: 'Consolas', 'Courier New', monospace;
}

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

.ns-block {
    padding: 7px 0;
}

/* ===== CATEGORY NAV ===== */
.ns-nav {
    background: var(--dk-surface);
    border-radius: var(--rad-lg);
    overflow: hidden;
    border: 1px solid var(--dk-border);
    margin-bottom: 8px;
}

.ns-nav-row {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--dk-border);
}

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

.ns-zone-name {
    width: 10%;
    min-width: 52px;
    font-size: 12px;
    font-weight: 700;
    color: #111;
    background: var(--dk-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 8px 3px;
    flex-shrink: 0;
    line-height: 1.3;
}

.ns-nav-links {
    width: 90%;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding: 7px 10px;
    align-items: center;
}

.ns-nav-links a {
    display: inline-block;
    color: var(--dk-text-soft);
    text-decoration: none;
    padding: 5px 4px;
    border-radius: var(--rad-sm);
    transition: var(--trs);
    background: var(--dk-surface2);
    border: 1px solid var(--dk-border);
    white-space: nowrap;
    text-align: center;
    font-size: 13px;
    width: calc((100% - 35px) / 8);
    flex-shrink: 0;
    flex-grow: 0;
}

.ns-nav-links a:hover {
    background: var(--dk-gold);
    color: #111;
    border-color: var(--dk-gold);
    box-shadow: 0 2px 8px rgba(245,166,35,0.3);
}

.ns-nav-links a.active {
    background: var(--dk-gold);
    color: #111;
    border-color: var(--dk-gold);
    font-weight: 700;
}

/* ===== SEARCH ===== */
.ns-search {
    background: var(--dk-surface);
    border-radius: var(--rad-lg);
    padding: 10px 14px;
    margin-bottom: 8px;
    border: 1px solid var(--dk-border);
}

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

.ns-search input[type="text"] {
    flex: 1;
    min-width: 120px;
    padding: 8px 13px;
    border: 1px solid var(--dk-border2);
    border-radius: var(--rad-md);
    background: var(--dk-bg);
    color: var(--dk-text);
    font-size: 13px;
    outline: none;
    transition: var(--trs);
}

.ns-search input[type="text"]:focus {
    border-color: var(--dk-gold);
    box-shadow: 0 0 0 2px rgba(245,166,35,0.2);
}

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

.ns-search button {
    padding: 8px 15px;
    border: none;
    border-radius: var(--rad-md);
    background: var(--grad-gold);
    color: #111;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: var(--trs);
    white-space: nowrap;
    flex-shrink: 0;
}

.ns-search button:hover {
    background: linear-gradient(135deg, #ffba45 0%, #f5a623 100%);
    box-shadow: 0 3px 10px rgba(245,166,35,0.35);
}

/* ===== HOT SEARCH TAGS ===== */
.ns-hotbox {
    background: var(--dk-surface);
    border-radius: var(--rad-lg);
    border: 1px solid var(--dk-border);
    margin-bottom: 8px;
}

.ns-hotbox-hd {
    padding: 9px 14px 5px;
}

.ns-hotbox-hd h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--dk-gold);
    margin: 0;
}

.ns-hot-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    padding: 5px 14px 11px;
}

.ns-tag {
    padding: 4px 12px;
    background: var(--dk-surface2);
    border-radius: var(--rad-sm);
    color: var(--dk-text-soft);
    text-decoration: none;
    font-size: 13px;
    transition: var(--trs);
    border: 1px solid var(--dk-border);
}

.ns-tag:hover {
    background: var(--dk-gold);
    color: #111;
    border-color: var(--dk-gold);
}

/* ===== SECTION HEADING ===== */
.ns-section {
    margin-bottom: 12px;
}

.ns-section-hd {
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--dk-border);
    position: relative;
}

.ns-section-hd::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 44px;
    height: 2px;
    background: var(--dk-gold);
}

.ns-section-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--dk-text);
    margin: 0;
}

.ns-section-title a {
    color: var(--dk-text);
    text-decoration: none;
    transition: var(--trs);
}

.ns-section-title a:hover {
    color: var(--dk-gold);
}

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

.ns-filmgrid li {
    animation: nsUp 0.4s ease backwards;
}

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

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

.ns-thumb {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: var(--rad-md);
    aspect-ratio: 600 / 350;
    background: var(--dk-surface2);
    border: 1px solid var(--dk-border);
}

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

.ns-thumb::before {
    content: '▶';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    font-size: 28px;
    color: rgba(255,255,255,0.45);
    z-index: 1;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.ns-thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.ns-thumb:hover img {
    transform: scale(1.06);
}

.ns-thumb:hover::before {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.ns-thumb:hover::after {
    opacity: 1;
}

.ns-thumb:hover {
    border-color: var(--dk-gold);
    box-shadow: 0 0 0 1px var(--dk-gold), var(--shadow-dk-md);
}

.ns-filminfo {
    padding: 6px 0 3px;
}

.ns-filminfo h5 {
    margin: 0;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
}

.ns-filminfo h5 a {
    color: var(--dk-text-soft);
    text-decoration: none;
    transition: var(--trs);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ns-filminfo h5 a:hover {
    color: var(--dk-gold);
}

/* ===== VIDEO PLAYER ===== */
.ns-player {
    width: 100%;
    height: 640px;
    max-height: 640px;
    margin-bottom: 14px;
    background: #000;
    border-radius: var(--rad-lg);
    overflow: hidden;
    box-shadow: var(--shadow-dk-md);
    position: relative;
}

.ns-player iframe,
.ns-player video,
.ns-player #video-container {
    width: 100%;
    height: 100%;
    border: none;
}

.MacPlayer {
    background: #000;
    border-radius: var(--rad-lg);
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: var(--shadow-dk-md);
}

/* ===== TORRENT PREVIEW ===== */
.ns-preview {
    /* no extra spacing */
}

.ns-preview img,
.ns-preview .img_item img {
    width: 100%;
    height: auto;
    border-radius: var(--rad-sm);
    border: 1px solid var(--dk-border);
    display: block;
}

.ns-preview .img_item {
    width: 100%;
}

/* ===== DETAIL INFO ===== */
.ns-detail-hd {
    line-height: 1.8;
    text-align: center;
    padding: 15px 18px;
    font-size: 17px;
    margin: 12px 0;
    word-break: break-all;
    background: var(--dk-surface);
    border-radius: var(--rad-lg);
    border-left: 4px solid var(--dk-gold);
}

.ns-detail-hd a {
    color: var(--dk-gold);
    text-decoration: none;
    font-weight: 600;
    margin-right: 8px;
}

.ns-spec-box {
    font-size: 15px;
    line-height: 1.9;
    padding: 18px 20px;
    background: var(--dk-surface);
    border-radius: var(--rad-lg);
    margin: 10px 0;
    border: 1px solid var(--dk-border);
    color: var(--dk-text-soft);
}

/* ===== ACTION BUTTONS ===== */
.ns-actions {
    text-align: center;
    padding: 13px;
    background: var(--dk-surface);
    border-radius: var(--rad-lg);
    margin: 10px 0;
    border: 1px solid var(--dk-border);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: nowrap;
    gap: 10px;
}

.ns-btn {
    display: inline-block;
    padding: 10px 22px;
    background: var(--grad-gold);
    color: #111;
    text-decoration: none;
    border-radius: var(--rad-md);
    font-weight: 700;
    font-size: 14px;
    transition: var(--trs);
    border: none;
    white-space: nowrap;
    flex-shrink: 0;
    cursor: pointer;
}

.ns-btn:hover {
    background: linear-gradient(135deg, #ffba45 0%, #f5a623 100%);
    box-shadow: 0 4px 12px rgba(245,166,35,0.4);
}

/* ===== SHARE/COPY ===== */
.ns-share {
    background: var(--dk-surface);
    border-radius: var(--rad-lg);
    padding: 13px;
    margin: 10px 0;
    border: 1px solid var(--dk-border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.ns-urlbox {
    background: var(--dk-bg);
    border: 1px solid var(--dk-border2);
    border-radius: var(--rad-md);
    padding: 9px 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.ns-url-lbl {
    font-weight: 700;
    font-size: 12px;
    color: var(--dk-gold);
    white-space: nowrap;
    flex-shrink: 0;
}

.ns-url-txt {
    font-size: 12px;
    color: var(--dk-text-muted);
    font-family: 'Consolas', 'Courier New', monospace;
    word-break: break-all;
    flex: 1;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ns-copy-btn {
    padding: 9px 17px;
    background: var(--grad-gold);
    color: #111;
    border: none;
    border-radius: var(--rad-md);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: var(--trs);
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    flex-shrink: 0;
}

.ns-copy-btn:hover {
    background: linear-gradient(135deg, #ffba45 0%, #f5a623 100%);
    box-shadow: 0 3px 10px rgba(245,166,35,0.35);
}

.ns-copy-btn:active {
    transform: scale(0.97);
}

.ns-ico {
    font-size: 15px;
}

/* ===== PAGINATION ===== */
.ns-pager {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    padding: 16px 0;
}

.ns-pg,
.ns-pg-cur {
    display: inline-block;
    padding: 7px 13px;
    border-radius: var(--rad-sm);
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: var(--trs);
    min-width: 36px;
    text-align: center;
}

.ns-pg {
    background: var(--dk-surface);
    color: var(--dk-text-soft);
    border: 1px solid var(--dk-border);
}

.ns-pg:hover {
    background: var(--dk-gold);
    border-color: var(--dk-gold);
    color: #111;
}

.ns-pg-cur {
    background: var(--grad-gold);
    color: #111;
    border: 1px solid var(--dk-gold);
    cursor: default;
}

/* ===== FOOTER ===== */
.ns-footer {
    padding: 18px 0;
    text-align: center;
    border-top: 1px solid var(--dk-border);
    margin-top: 16px;
    background: var(--dk-bg2);
}

.ns-footer p {
    margin: 5px 0;
    color: var(--dk-text-muted);
    font-size: 12px;
}

.ns-footer a {
    color: var(--dk-text-muted);
    text-decoration: none;
    transition: var(--trs);
}

.ns-footer a:hover {
    color: var(--dk-gold);
}

/* ===== FRIENDLY LINKS ===== */
.ns-links {
    padding: 11px 14px;
    background: var(--dk-surface);
    border-radius: var(--rad-lg);
    border: 1px solid var(--dk-border);
}

.ns-links dl { margin: 0; }

.ns-links dd {
    display: inline-block;
    margin: 3px;
}

.ns-links a {
    color: var(--dk-text-muted);
    text-decoration: none;
    font-size: 13px;
    transition: var(--trs);
    padding: 2px 4px;
}

.ns-links a:hover {
    color: var(--dk-gold);
}

/* ===== VISIBILITY ===== */
.vis-pc  { display: block; }
.vis-mob { display: block; }

@media (max-width: 768px) { .vis-pc  { display: none !important; } }
@media (min-width: 769px) { .vis-mob { display: none !important; } }

/* ===== CLEARFIX ===== */
.cf::after { content: ""; display: table; clear: both; }

/* ===== LAZY IMG ===== */
img[data-original] { background: var(--dk-surface2); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .ns-wrap { padding: 0 8px; }
    .ns-block { padding: 5px 0; }

    /* Nav zone: 15% / 10px label */
    .ns-zone-name {
        width: 15%;
        min-width: 0;
        font-size: 10px;
        padding: 7px 2px;
    }

    .ns-nav-links {
        width: 85%;
        gap: 3px;
        padding: 6px 6px;
    }

    /* Small screen 12px, 4 per row */
    .ns-nav-links a {
        font-size: 12px;
        padding: 4px 2px;
        width: calc((100% - 9px) / 4);
        flex-shrink: 0;
        flex-grow: 0;
    }

    /* Film grid: 2 per row */
    .ns-filmgrid {
        grid-template-columns: repeat(2, 1fr);
        gap: 9px;
    }

    .ns-section-title { font-size: 15px; }
    .ns-section { margin-bottom: 8px; }
    .ns-filminfo h5 { font-size: 12px; }

    .ns-player {
        height: 56.25vw;
        max-height: 380px;
        margin-bottom: 10px;
    }

    .ns-search { padding: 8px 10px; }
    .ns-search input[type="text"] { min-width: 90px; padding: 7px 10px; font-size: 12px; }
    .ns-search button { padding: 7px 10px; font-size: 12px; }

    .ns-hot-tags { gap: 5px; }
    .ns-tag { padding: 4px 10px; font-size: 12px; }

    .ns-actions { padding: 9px 6px; gap: 7px; flex-wrap: nowrap; }
    .ns-btn { padding: 9px 13px; font-size: 13px; }

    .ns-share { padding: 9px; gap: 7px; flex-wrap: nowrap; }
    .ns-urlbox { padding: 7px 9px; gap: 5px; flex: 1; min-width: 0; }
    .ns-url-lbl { font-size: 11px; }
    .ns-url-txt { font-size: 10px; }
    .ns-copy-btn { padding: 8px 11px; font-size: 11px; gap: 3px; flex-shrink: 0; }
    .ns-ico { font-size: 13px; }

    .ns-pager { gap: 4px; padding: 12px 0; }
    .ns-pg, .ns-pg-cur { padding: 6px 10px; font-size: 12px; min-width: 32px; }

    .ns-footer { padding: 14px 0; margin-top: 12px; }
    .ns-site-title { font-size: 19px; }
    .ns-domain-url { font-size: 15px; }
}

/* Large mobile: 14px nav */
@media (min-width: 481px) and (max-width: 768px) {
    .ns-nav-links a { font-size: 14px; }
}

@media (max-width: 480px) {
    .ns-zone-name { width: 15%; font-size: 10px; padding: 6px 2px; }
    .ns-nav-links { width: 85%; gap: 3px; padding: 5px 4px; }
    .ns-nav-links a { font-size: 12px; padding: 3px 1px; width: calc((100% - 9px) / 4); }

    .ns-filmgrid { grid-template-columns: repeat(2, 1fr); gap: 7px; }
    .ns-player { height: 56.25vw; max-height: 280px; }

    .ns-site-title { font-size: 17px; }
    .ns-domain-url { font-size: 14px; }
    .ns-domain-tag { font-size: 10px; }

    .ns-detail-hd { font-size: 15px; padding: 11px 12px; }
    .ns-actions { padding: 8px 4px; gap: 5px; }
    .ns-btn { padding: 8px 10px; font-size: 12px; }
    .ns-share { padding: 8px; gap: 5px; }
}
