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

:root {
    --snow: #ffffff;
    --bg: #f2f2f2;
    --card: #ffffff;
    --raised: #f8f8f8;
    --qd-red: #e1261c;
    --qd-red-dk: #b91c14;
    --qd-red-lt: rgba(225,38,28,.09);
    --qd-dark: #222222;
    --qd-nav: #2d2d2d;
    --qd-orange: #ff6600;
    --ink: #111111;
    --body: #333333;
    --mid: #555555;
    --dim: #888888;
    --ghost: #bbbbbb;
    --edge: #e0e0e0;
    --edge2: #d0d0d0;
    --q1: 0 1px 3px rgba(0,0,0,.06);
    --q2: 0 3px 12px rgba(0,0,0,.09);
    --q3: 0 6px 22px rgba(0,0,0,.13);
    --qr: 4px;
    --qr2: 3px;
    --qr3: 6px;
}

html { font-size: 15px; }

body {
    background: var(--bg);
    color: var(--ink);
    font-family: 'PingFang SC','Hiragino Sans GB','Microsoft YaHei','Helvetica Neue',Arial,sans-serif;
    line-height: 1.65;
}

a { color: var(--body); text-decoration: none; transition: color .15s; }
a:hover { color: var(--qd-red); }
img { max-width: 100%; display: block; }
ul { list-style: none; }
.qd-cf::after { content: ''; display: table; clear: both; }

/* ===== WRAPPER ===== */
.qd-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 14px;
}

/* ===== SITE HEADER ===== */
.qd-header {
    background: var(--snow);
    border-bottom: 3px solid var(--qd-red);
    padding: 8px 0;
    box-shadow: var(--q1);
}

.qd-header .qd-container {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: nowrap;
}

.qd-branding {
    display: flex;
    align-items: center;
    gap: 11px;
    flex-shrink: 0;
}

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

.qd-site-title {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--qd-red);
    font-style: normal;
    letter-spacing: -.5px;
    text-decoration: none;
    border-bottom: none;
}

.qd-domain-box {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--raised);
    border: 1px solid var(--edge2);
    border-radius: var(--qr2);
    padding: 4px 11px;
}

.qd-domain-box .qdb-hint {
    font-size: .67rem;
    color: var(--dim);
    white-space: nowrap;
}

.qd-domain-box .qdb-val {
    font-size: 1.08rem;
    font-weight: 800;
    color: var(--qd-red);
    white-space: nowrap;
}

/* ===== NAV BAR ===== */
.qd-navbar {
    background: var(--qd-nav);
    padding: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,.2);
}

/* ===== BANNER ===== */
.qd-banner {
    margin: 4px 0 3px;
}
.qd-banner img { border-radius: var(--qr); width: 100%; }

/* ===== CATEGORY NAV ===== */
.qd-catblock {
    background: var(--card);
    border: 1px solid var(--edge);
    border-radius: var(--qr3);
    overflow: hidden;
    margin: 3px 0;
    box-shadow: var(--q1);
}

.qd-catrow {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--edge);
    min-height: 38px;
}

.qd-catrow:last-child { border-bottom: none; }

.qd-zone-flag {
    background: var(--qd-dark);
    color: rgba(255,255,255,.82);
    font-size: .67rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px 2px;
    width: 62px;
    min-width: 62px;
    border-right: 1px solid rgba(255,255,255,.07);
    text-align: center;
    line-height: 1.3;
    letter-spacing: .3px;
    flex-shrink: 0;
}

.qd-catitems {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    align-items: center;
    padding: 4px 8px;
    gap: 3px;
    flex: 1;
}

.qd-catitems a {
    font-size: .81rem;
    color: var(--mid);
    padding: 4px 5px;
    border-radius: var(--qr2);
    transition: all .15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    border: 1px solid transparent;
    text-decoration: none;
    display: block;
}

.qd-catitems a:hover {
    background: var(--qd-red-lt);
    color: var(--qd-red);
    border-color: rgba(225,38,28,.18);
}

.qd-catitems a.active {
    background: var(--qd-red);
    color: #fff;
    border-color: var(--qd-red);
    font-weight: 700;
}

/* ===== SEARCH ===== */
.qd-searchbar {
    background: var(--card);
    border: 1px solid var(--edge);
    border-radius: var(--qr3);
    padding: 7px 11px;
    margin: 3px 0;
    box-shadow: var(--q1);
}

.qd-searchbar form {
    display: flex;
    gap: 5px;
    align-items: center;
    flex-wrap: nowrap;
    width: 100%;
}

.qd-searchbar input[type="text"] {
    flex: 1;
    min-width: 0;
    height: 36px;
    border: 1.5px solid var(--edge2);
    border-radius: var(--qr2);
    padding: 0 13px;
    font-size: .86rem;
    color: var(--ink);
    background: var(--raised);
    outline: none;
    transition: border-color .18s, background .18s;
}

.qd-searchbar input[type="text"]::placeholder { color: var(--ghost); }
.qd-searchbar input[type="text"]:focus {
    border-color: var(--qd-red);
    background: var(--snow);
}

.qd-searchbar button {
    height: 36px;
    padding: 0 13px;
    border: none;
    border-radius: var(--qr2);
    background: var(--mid);
    color: #fff;
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s;
    flex-shrink: 0;
}

.qd-searchbar button:hover { background: var(--body); }

.qd-searchbar button[value="1"] {
    background: var(--qd-red);
    color: #fff;
    font-weight: 700;
}
.qd-searchbar button[value="1"]:hover { background: var(--qd-red-dk); }

.qd-searchbar button[value="2"] {
    background: var(--qd-dark);
    color: #fff;
    font-weight: 700;
}
.qd-searchbar button[value="2"]:hover { background: #000; }

/* ===== HOT TAGS ===== */
.qd-hotband {
    background: var(--card);
    border: 1px solid var(--edge);
    border-radius: var(--qr3);
    padding: 6px 11px;
    margin: 3px 0;
    box-shadow: var(--q1);
}

.qd-hotband h4 {
    font-size: .74rem;
    font-weight: 700;
    color: var(--dim);
    margin-bottom: 5px;
    letter-spacing: .4px;
}

.qd-hotband h4 strong { color: var(--qd-red); }

.qd-hotrow {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.qd-hotrow .qdtag {
    display: inline-block;
    background: var(--raised);
    color: var(--mid);
    border: 1px solid var(--edge2);
    border-radius: var(--qr2);
    padding: 2px 9px;
    font-size: .73rem;
    text-decoration: none;
    transition: all .15s;
}

.qd-hotrow .qdtag:hover {
    background: var(--qd-red-lt);
    color: var(--qd-red);
    border-color: rgba(225,38,28,.2);
}

/* ===== CONTENT SECTION ===== */
.qd-segment {
    background: var(--card);
    border: 1px solid var(--edge);
    border-radius: var(--qr3);
    padding: 11px 12px 10px;
    margin: 3px 0;
    box-shadow: var(--q1);
}

.qd-seg-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 9px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--edge);
    position: relative;
}

.qd-seg-hd::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 38px;
    height: 2px;
    background: var(--qd-red);
    border-radius: 2px;
}

.qd-seg-hd h3 {
    font-size: .96rem;
    font-weight: 800;
    color: var(--ink);
}

.qd-seg-hd h3 a { color: var(--ink); }
.qd-seg-hd h3 a:hover { color: var(--qd-red); }

.qd-seg-hd h4 {
    font-size: .94rem;
    font-weight: 800;
    color: var(--ink);
}

/* ===== FILM GRID ===== */
.qd-filmlist {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 9px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.qd-filmlist li {
    border-radius: var(--qr);
    overflow: hidden;
    border: 1px solid var(--edge);
    background: var(--raised);
    transition: box-shadow .2s, border-color .2s, transform .2s;
}

.qd-filmlist li:hover {
    box-shadow: var(--q3);
    border-color: rgba(225,38,28,.3);
    transform: translateY(-2px);
}

.qd-filmthumb {
    display: block;
    width: 100%;
    aspect-ratio: 600 / 350;
    overflow: hidden;
    background: #f0e8e8;
}

.qd-filmthumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}

.qd-filmthumb:hover img { transform: scale(1.04); }

.qd-filmfoot {
    padding: 5px 7px 7px;
}

.qd-filmfoot h5 {
    font-size: .75rem;
    font-weight: 400;
    color: var(--mid);
    line-height: 1.45;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.qd-filmfoot h5 a { color: var(--mid); }
.qd-filmfoot h5 a:hover { color: var(--qd-red); }

/* ===== PAGINATION ===== */
.qd-paging {
    margin: 12px 0 5px;
    display: flex;
    justify-content: center;
}

.qd-pglist {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    justify-content: center;
}

.qd-pglist a.qdpg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 9px;
    background: var(--card);
    border: 1.5px solid var(--edge2);
    border-radius: var(--qr2);
    font-size: .82rem;
    color: var(--mid);
    text-decoration: none;
    transition: all .15s;
}

.qd-pglist a.qdpg:hover {
    background: var(--qd-red-lt);
    border-color: var(--qd-red);
    color: var(--qd-red);
}

.qd-pglist a.qdpg-now {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 9px;
    background: var(--qd-red);
    border: 1.5px solid var(--qd-red);
    border-radius: var(--qr2);
    font-size: .82rem;
    font-weight: 700;
    color: #fff;
    cursor: default;
}

/* ===== FOOTER ===== */
.qd-flinks {
    background: var(--card);
    border: 1px solid var(--edge);
    border-radius: var(--qr);
    padding: 8px 12px;
    margin: 3px 0;
    box-shadow: var(--q1);
}

.qd-fldl {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.qd-fldl dd { display: inline; }

.qd-fldl a {
    display: inline-block;
    font-size: .74rem;
    color: var(--ghost);
    padding: 2px 9px;
    border-radius: var(--qr2);
    border: 1px solid var(--edge);
    background: var(--bg);
    text-decoration: none;
    transition: all .15s;
}

.qd-fldl a:hover { color: var(--qd-red); border-color: rgba(225,38,28,.28); }

.qd-footcopy {
    text-align: center;
    padding: 7px 0 13px;
    color: var(--ghost);
    font-size: .73rem;
}

/* ===== DETAIL PAGES ===== */
.qd-item-title {
    line-height: 1.8;
    text-align: center;
    padding: 11px 14px;
    font-size: .96rem;
    margin: 3px 0;
    word-break: break-all;
    background: var(--card);
    border: 1px solid var(--edge);
    border-left: 4px solid var(--qd-red);
    border-radius: var(--qr);
    box-shadow: var(--q1);
    color: var(--ink);
}

.qd-item-title a {
    color: var(--qd-red);
    font-weight: 700;
    margin-right: 6px;
}

.qd-item-desc {
    font-size: .88rem;
    line-height: 2;
    padding: 13px 16px;
    background: var(--card);
    border: 1px solid var(--edge);
    border-radius: var(--qr);
    box-shadow: var(--q1);
    margin: 3px 0;
    color: var(--mid);
}

.qd-preview-img {
    display: block;
    width: 100%;
    margin-top: 9px;
}

.qd-preview-img picture,
.qd-preview-img img {
    width: 100%;
    height: auto;
    border-radius: var(--qr2);
    display: block;
}

/* ===== DL BUTTONS ===== */
.qd-action-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0;
}

.qd-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    background: var(--qd-red);
    color: #fff;
    border: none;
    border-radius: var(--qr2);
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .18s, transform .15s;
    text-decoration: none;
    letter-spacing: .2px;
}

.qd-btn:hover {
    background: var(--qd-red-dk);
    color: #fff;
    transform: translateY(-1px);
}

.qd-app-hint {
    text-align: center;
    padding: 6px;
    font-size: .8rem;
}

.qd-app-hint a { color: var(--dim); font-weight: 600; }
.qd-app-hint a:hover { color: var(--qd-red); }

/* ===== SHARE ===== */
.qd-shareline {
    display: flex;
    align-items: center;
    gap: 9px;
    background: var(--raised);
    border: 1px solid var(--edge);
    border-radius: var(--qr);
    padding: 7px 12px;
    margin: 3px 0;
    flex-wrap: wrap;
}

.qd-shareline .qsl-lbl { font-size: .73rem; color: var(--ghost); white-space: nowrap; }
.qd-shareline .qsl-url { font-size: .76rem; color: var(--mid); flex: 1; min-width: 0; word-break: break-all; }

.qd-shareline .qsl-copy {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    background: var(--qd-red);
    color: #fff;
    border: none;
    border-radius: var(--qr2);
    font-size: .78rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
    flex-shrink: 0;
}

.qd-shareline .qsl-copy:hover { background: var(--qd-red-dk); }

/* ===== VIS HELPERS ===== */
.qd-pc { display: block; }
.qd-mb { display: none; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    .qd-filmlist { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .qd-pc { display: none; }
    .qd-mb { display: block; }
}

@media (max-width: 768px) {
    html { font-size: 14px; }

    .qd-site-title { font-size: 1.1rem; }
    .qd-domain-box .qdb-val { font-size: .9rem; }

    .qd-catrow { align-items: stretch; }

    .qd-zone-flag {
        width: 15%;
        min-width: 15%;
        max-width: 15%;
        font-size: 10px;
        padding: 4px 2px;
        letter-spacing: 0;
        line-height: 1.4;
        word-break: break-all;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .qd-catitems {
        width: 85%;
        flex: 1;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 3px;
        padding: 4px 4px;
        align-items: center;
    }

    .qd-catitems a {
        font-size: 12px;
        padding: 5px 2px;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
    }

    /* Search: NO wrap, all in one row */
    .qd-searchbar form {
        flex-wrap: nowrap;
        gap: 3px;
    }

    .qd-searchbar input[type="text"] {
        height: 32px;
        font-size: .77rem;
        padding: 0 8px;
    }

    .qd-searchbar button {
        height: 32px;
        padding: 0 6px;
        font-size: .72rem;
    }

    .qd-filmlist {
        grid-template-columns: repeat(2, 1fr);
        gap: 7px;
    }

    .qd-filmthumb { aspect-ratio: 600 / 350; }
    .qd-filmfoot h5 { font-size: .7rem; }
    .qd-segment { padding: 8px 8px 6px; }
    .qd-btn { padding: 9px 16px; font-size: .84rem; }
}

@media (min-width: 481px) and (max-width: 768px) {
    .qd-zone-flag { font-size: 10px; }
    .qd-catitems a { font-size: 13px; }
}

@media (max-width: 380px) {
    .qd-zone-flag { font-size: 10px; }
    .qd-catitems a { font-size: 12px; }
    .qd-searchbar button { padding: 0 4px; font-size: .66rem; }
}
