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

:root {
    --bg-page: #f3f3f3;
    --bg-white: #ffffff;
    --bg-soft: #f9f9f9;
    --bg-muted: #efefef;
    --charcoal: #202020;
    --charcoal2: #2d2d2d;
    --charcoal3: #3a3a3a;
    --msblue: #0078d4;
    --msblue-dk: #005a9e;
    --msblue-lt: #e5f1fb;
    --msteal: #00b7c3;
    --accent2: #0067b8;
    --txt: #202020;
    --txt2: #404040;
    --txt3: #767676;
    --bdr: #e0e0e0;
    --bdr2: #c8c8c8;
    --sh1: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
    --sh2: 0 2px 8px rgba(0,0,0,.10), 0 1px 3px rgba(0,0,0,.06);
    --sh3: 0 4px 16px rgba(0,0,0,.13), 0 2px 6px rgba(0,0,0,.08);
    --r: 6px;
    --r2: 4px;
    --r3: 8px;
}

html { font-size: 15px; }

body {
    background: var(--bg-page);
    color: var(--txt);
    font-family: 'Segoe UI','PingFang SC','Microsoft YaHei','Helvetica Neue',Arial,sans-serif;
    line-height: 1.6;
}

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

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

/* ===== SITE HEADER ===== */
.ms-topbar {
    background: var(--charcoal);
    padding: 9px 0;
    box-shadow: 0 1px 0 rgba(255,255,255,.06);
}

.ms-topbar .ms-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: nowrap;
}

.ms-brand-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

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

.ms-site-name {
    font-size: 1.38rem;
    font-weight: 700;
    color: #fff;
    font-style: normal;
    letter-spacing: -.2px;
    text-decoration: none;
    border-bottom: none;
}

.ms-domain-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 20px;
    padding: 4px 14px;
}

.ms-domain-tag .dt-label {
    font-size: 0.7rem;
    color: rgba(255,255,255,.55);
    white-space: nowrap;
}

.ms-domain-tag .dt-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
}

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

/* ===== CATEGORY NAV ===== */
.ms-navbox {
    background: var(--charcoal2);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: var(--r);
    overflow: hidden;
    margin: 4px 0;
    box-shadow: var(--sh1);
}

.ms-navrow {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid rgba(255,255,255,.06);
    min-height: 38px;
}

.ms-navrow:last-child { border-bottom: none; }

.ms-zone-lbl {
    background: rgba(0,0,0,.35);
    color: rgba(255,255,255,.7);
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px 2px;
    width: 62px;
    min-width: 62px;
    border-right: 1px solid rgba(255,255,255,.06);
    text-align: center;
    line-height: 1.3;
    letter-spacing: .3px;
    flex-shrink: 0;
}

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

.ms-navlinks a {
    font-size: .82rem;
    color: rgba(255,255,255,.78);
    padding: 3px 6px;
    border-radius: var(--r2);
    transition: all .15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
    border: 1px solid transparent;
    text-decoration: none;
    display: block;
}

.ms-navlinks a:hover {
    background: rgba(0,120,212,.35);
    color: #fff;
    border-color: rgba(0,120,212,.5);
    text-decoration: none;
}

.ms-navlinks a.active {
    background: var(--msblue);
    color: #fff;
    border-color: var(--msblue);
    font-weight: 600;
}

/* ===== SEARCH ===== */
.ms-searchbar {
    background: var(--bg-white);
    border: 1px solid var(--bdr);
    border-radius: var(--r);
    padding: 8px 12px;
    margin: 4px 0;
    box-shadow: var(--sh1);
}

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

.ms-searchbar input[type="text"] {
    flex: 1;
    min-width: 0;
    height: 36px;
    border: 1px solid var(--bdr2);
    border-radius: 20px;
    padding: 0 16px;
    font-size: .88rem;
    color: var(--txt);
    background: var(--bg-soft);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    font-family: inherit;
}

.ms-searchbar input[type="text"]:focus {
    border-color: var(--msblue);
    background: var(--bg-white);
    box-shadow: 0 0 0 2px rgba(0,120,212,.15);
}

.ms-searchbar button {
    height: 36px;
    padding: 0 13px;
    border: none;
    border-radius: 20px;
    background: var(--charcoal);
    color: #fff;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s;
    flex-shrink: 0;
    font-family: inherit;
}

.ms-searchbar button:hover { background: var(--charcoal3); }

.ms-searchbar button[value="1"] { background: var(--msblue); }
.ms-searchbar button[value="1"]:hover { background: var(--msblue-dk); }

.ms-searchbar button[value="2"] {
    background: var(--bg-white);
    color: var(--msblue);
    border: 1px solid var(--msblue);
}
.ms-searchbar button[value="2"]:hover { background: var(--msblue-lt); }

/* ===== HOT TAGS ===== */
.ms-tagzone {
    background: var(--bg-white);
    border: 1px solid var(--bdr);
    border-radius: var(--r);
    padding: 7px 12px;
    margin: 4px 0;
    box-shadow: var(--sh1);
}

.ms-tagzone h4 {
    font-size: .79rem;
    font-weight: 600;
    color: var(--charcoal);
    margin-bottom: 5px;
}

.ms-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.ms-tags .ms-tag {
    display: inline-block;
    background: var(--bg-muted);
    color: var(--txt2);
    border: 1px solid var(--bdr);
    border-radius: 12px;
    padding: 2px 10px;
    font-size: .76rem;
    text-decoration: none;
    transition: all .15s;
}

.ms-tags .ms-tag:hover {
    background: var(--msblue-lt);
    color: var(--msblue);
    border-color: var(--msblue);
    text-decoration: none;
}

/* ===== CONTENT SECTION ===== */
.ms-section {
    background: var(--bg-white);
    border: 1px solid var(--bdr);
    border-radius: var(--r3);
    padding: 13px 13px 10px;
    margin: 4px 0;
    box-shadow: var(--sh1);
}

.ms-section-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 7px;
    border-bottom: 1px solid var(--bg-muted);
    position: relative;
}

.ms-section-hd::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 32px;
    height: 2px;
    background: var(--msblue);
    border-radius: 2px;
}

.ms-section-hd h3 {
    font-size: .98rem;
    font-weight: 700;
    color: var(--charcoal);
}

.ms-section-hd h3 a { color: var(--charcoal); text-decoration: none; }
.ms-section-hd h3 a:hover { color: var(--msblue); text-decoration: none; }

.ms-section-hd h4 {
    font-size: .95rem;
    font-weight: 700;
    color: var(--charcoal);
}

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

.ms-grid li {
    border-radius: var(--r2);
    overflow: hidden;
    border: 1px solid var(--bdr);
    background: var(--bg-soft);
    transition: box-shadow .2s, transform .2s;
}

.ms-grid li:hover {
    box-shadow: var(--sh3);
    transform: translateY(-2px);
}

.ms-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 600 / 350;
    overflow: hidden;
    background: var(--bg-muted);
}

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

.ms-thumb:hover img { transform: scale(1.04); }

.ms-item-info {
    padding: 5px 7px 7px;
}

.ms-item-info h5 {
    font-size: .78rem;
    font-weight: 500;
    color: var(--txt);
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.ms-item-info h5 a { color: var(--txt); text-decoration: none; }
.ms-item-info h5 a:hover { color: var(--msblue); text-decoration: underline; }

/* ===== PAGINATION ===== */
.ms-pager {
    margin: 14px 0 6px;
    display: flex;
    justify-content: center;
}

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

.ms-pages a.mp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    background: var(--bg-white);
    border: 1px solid var(--bdr2);
    border-radius: var(--r2);
    font-size: .84rem;
    color: var(--txt2);
    text-decoration: none;
    transition: all .15s;
}

.ms-pages a.mp:hover {
    background: var(--msblue-lt);
    border-color: var(--msblue);
    color: var(--msblue);
    text-decoration: none;
}

.ms-pages a.mp-cur {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    background: var(--msblue);
    border: 1px solid var(--msblue);
    border-radius: var(--r2);
    font-size: .84rem;
    font-weight: 700;
    color: #fff;
    cursor: default;
}

/* ===== FOOTER ===== */
.ms-flinks-box {
    background: var(--charcoal2);
    border: 1px solid rgba(255,255,255,.05);
    border-radius: var(--r);
    padding: 9px 13px;
    margin: 4px 0;
    box-shadow: var(--sh1);
}

.ms-flinks {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.ms-flinks dd { display: inline; }

.ms-flinks a {
    display: inline-block;
    font-size: .77rem;
    color: rgba(255,255,255,.5);
    padding: 2px 9px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.05);
    text-decoration: none;
    transition: all .15s;
}

.ms-flinks a:hover {
    color: #fff;
    border-color: rgba(255,255,255,.3);
    background: rgba(255,255,255,.12);
    text-decoration: none;
}

.ms-copyright {
    text-align: center;
    padding: 8px 0 14px;
    color: rgba(255,255,255,.3);
    font-size: .76rem;
}

/* ===== DETAIL PAGES ===== */
.ms-entry-title {
    line-height: 1.8;
    text-align: center;
    padding: 12px 15px;
    font-size: .98rem;
    margin: 4px 0;
    word-break: break-all;
    background: var(--bg-white);
    border: 1px solid var(--bdr);
    border-left: 3px solid var(--msblue);
    border-radius: var(--r);
    box-shadow: var(--sh1);
}

.ms-entry-title a {
    color: var(--msblue);
    font-weight: 600;
    margin-right: 6px;
    text-decoration: none;
}

.ms-entry-body {
    font-size: .9rem;
    line-height: 1.95;
    padding: 15px 18px;
    background: var(--bg-white);
    border: 1px solid var(--bdr);
    border-radius: var(--r);
    box-shadow: var(--sh1);
    margin: 4px 0;
}

.ms-preview {
    display: block;
    width: 100%;
    margin-top: 10px;
}

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

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

.ms-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 9px 22px;
    background: var(--msblue);
    color: #fff;
    border: none;
    border-radius: var(--r2);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, box-shadow .15s, transform .15s;
    text-decoration: none;
    font-family: inherit;
    box-shadow: 0 2px 6px rgba(0,120,212,.3);
}

.ms-action-btn:hover {
    background: var(--msblue-dk);
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,120,212,.35);
}

.ms-client-tip {
    text-align: center;
    padding: 7px;
    font-size: .82rem;
}

.ms-client-tip a { color: var(--charcoal); font-weight: 600; text-decoration: none; }
.ms-client-tip a:hover { color: var(--msblue); text-decoration: underline; }

/* ===== SHARE BAR ===== */
.ms-share-row {
    display: flex;
    align-items: center;
    gap: 9px;
    background: var(--bg-soft);
    border: 1px solid var(--bdr);
    border-radius: var(--r);
    padding: 8px 13px;
    margin: 4px 0;
    flex-wrap: wrap;
}

.ms-share-row .sr-lbl { font-size: .77rem; color: var(--txt3); white-space: nowrap; }
.ms-share-row .sr-url { font-size: .79rem; color: var(--txt2); flex: 1; min-width: 0; word-break: break-all; }

.ms-share-row .sr-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    background: var(--msblue);
    color: #fff;
    border: none;
    border-radius: var(--r2);
    font-size: .8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
    flex-shrink: 0;
    font-family: inherit;
}

.ms-share-row .sr-btn:hover { background: var(--msblue-dk); }

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

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

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

    .ms-site-name { font-size: 1.06rem; }
    .ms-domain-tag .dt-value { font-size: .94rem; }

    .ms-navrow { align-items: stretch; }

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

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

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

    /* Search: single row, no wrap */
    .ms-searchbar form {
        flex-wrap: nowrap;
        gap: 4px;
    }

    .ms-searchbar input[type="text"] {
        height: 34px;
        font-size: .79rem;
        padding: 0 10px;
    }

    .ms-searchbar button {
        height: 34px;
        padding: 0 8px;
        font-size: .74rem;
    }

    /* Film grid: 2 col */
    .ms-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 7px;
    }

    .ms-thumb { aspect-ratio: 600 / 350; }
    .ms-item-info h5 { font-size: .72rem; }
    .ms-section { padding: 9px 9px 7px; }
    .ms-action-btn { padding: 8px 14px; font-size: .84rem; }
}

@media (min-width: 481px) and (max-width: 768px) {
    .ms-zone-lbl { font-size: 10px; }
    .ms-navlinks a { font-size: 13px; }
}

@media (max-width: 380px) {
    .ms-zone-lbl { font-size: 10px; }
    .ms-navlinks a { font-size: 12px; }
    .ms-searchbar button { padding: 0 5px; font-size: .68rem; }
}
