/* Shared presentation layer. Template data, routes and player integrations stay in place. */
:root {
    --page: #f4f6fa;
    --surface: #fff;
    --ink: #202b3d;
    --muted: #65738a;
    --line: #e2e7ef;
    --brand: #216bd6;
    --brand-hover: #1754ad;
    --soft-blue: #edf4ff;
    --radius: 14px;
    --shadow: 0 8px 28px rgba(26, 43, 73, .06);
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--page);
    color: var(--ink);
    font: 15px/1.7 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Microsoft JhengHei", "Microsoft YaHei", sans-serif;
    -webkit-text-size-adjust: 100%;
}
a { color: var(--brand); text-decoration: none; transition: color .18s, background-color .18s, border-color .18s; }
a:hover { color: var(--brand-hover); }
button, input, select, textarea { font: inherit; }
button, select, input[type="submit"], input[type="image"] { cursor: pointer; }
button, input, select, textarea { accent-color: var(--brand); }
img { max-width: 100%; vertical-align: middle; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #73aaff; outline-offset: 4px; }
::selection { background: #d7e7ff; color: #173c72; }

/* Navigation keeps the existing IDs and JavaScript entry points. */
.header {
    position: relative;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 30px;
    width: 100%;
    min-height: 84px;
    padding: 16px max(24px, calc((100% - 1240px) / 2));
    background: #151e2d;
    box-shadow: 0 4px 20px rgba(15, 25, 43, .1);
}
.brand { flex: 0 0 auto; }
.title { line-height: 1; }
.title img { display: block; width: 106px; height: auto; }
.n_middle { display: flex; align-items: center; gap: 6px; }
.navigator { position: static; }
.n_name { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 14px; border-radius: 9px; color: #b9c5d8; white-space: nowrap; font-weight: 600; }
.n_name:hover, .n_name[aria-expanded="true"] { color: #fff; background: #263247; }
.n_name[aria-current="page"] { background: #2a6dd5; color: #fff; }
.n_icon, .n_icon_text { display: none; }
.n_subs {
    position: absolute;
    top: calc(100% - 8px);
    display: flex;
    gap: 12px;
    width: 520px;
    max-width: calc(100vw - 32px);
    max-height: min(560px, calc(100vh - 160px));
    height: 0;
    overflow: hidden;
    visibility: hidden;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 18px 48px rgba(15, 25, 43, .2);
    text-align: left;
}
.n_name[aria-expanded="true"] + .n_subs { height: auto !important; padding: 14px !important; overflow-y: auto; visibility: visible; border: 1px solid var(--line); }
.n_col { flex: 1 1 0; min-width: 0; }
.n_col ul { margin: 0; padding: 0; list-style: none; }
.n_col a { display: block; padding: 9px 8px; border-radius: 7px; color: #4b5b73; overflow-wrap: anywhere; font-size: 13px; }
.n_col a:hover, .n_col a:focus-visible { color: var(--brand); background: var(--soft-blue); }
.search { position: relative; flex: 1 1 260px; max-width: 340px; margin-left: auto; }
.search form { position: relative; display: flex; align-items: center; gap: 10px; padding: 0 12px 0 15px; background: #fff; border: 1px solid transparent; border-radius: 10px; }
.search form:focus-within { border-color: #73aaff; box-shadow: 0 0 0 3px rgba(115, 170, 255, .2); }
.search_text { width: 100%; min-width: 0; height: 44px; border: 0; background: transparent; font-size: 14px; outline: none; }
.search_submit { flex: 0 0 24px; width: 24px; height: 24px; padding: 2px; border: 0; }
.search_button { display: none; }
.search_button a { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 1px solid #39475e; border-radius: 9px; }
.search_button a div { width: 22px; height: 22px; background: url('/static/magnifier_focus.png') center/contain no-repeat; }
.header #suggestions_box { position: absolute; top: calc(100% + 8px); left: 0; z-index: 110; width: 100%; max-width: none; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.header #suggestions_box ul { max-height: 350px; overflow-y: auto; }
.header #suggestions_box li { height: auto; min-height: 42px; padding: 0; line-height: 1.5; }
.header #suggestions_box li a { display: block; padding: 11px 15px; color: #4b5b73; }
.header #suggestions_box li a:hover { background: var(--soft-blue); color: var(--brand); }

/* Page headings, cards and filters. */
.content, #movie_content, #suggestion { width: calc(100% - 48px); max-width: 1240px; margin: 38px auto 0 !important; }
#content_title, #m_title, #s_title { margin: 0 0 24px; padding: 0 0 20px; border-bottom: 1px solid #dce3ee; text-align: left; }
#content_title_text, #m_title_text, #s_title_text { margin: 0; color: #202b3d; font-size: clamp(21px, 2.2vw, 29px); font-weight: 750; letter-spacing: -.025em; line-height: 1.5; overflow-wrap: anywhere; }
#content_title_text::before, #s_title_text::before { content: ''; display: inline-block; width: 5px; height: .85em; margin-right: 12px; border-radius: 3px; background: var(--brand); }
.movie-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px 22px; margin: 26px 0; text-align: left; }
.movie { min-width: 0; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 2px 4px rgba(26, 43, 73, .025); transition: transform .18s, box-shadow .18s, border-color .18s; }
.movie_image { position: relative; overflow: hidden; background: #e7ecf4; }
.movie_image > a { display: block; }
.movie_image img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; }
.movie > a { display: -webkit-box; min-height: 76px; padding: 14px 16px; overflow: hidden; color: #344158; font-size: 14px; font-weight: 600; line-height: 1.7; overflow-wrap: anywhere; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.movie:hover > a { color: var(--brand); }
.movie.native_ads { display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; background: transparent; border-color: transparent; box-shadow: none; }
.movie.native_ads video { width: 100%; height: auto; min-height: 0; aspect-ratio: 16 / 10; object-fit: cover; }
.image_magnify { display: none; position: absolute; top: 10px; right: 10px; z-index: 2; width: 34px; height: 34px; border-radius: 8px; background: rgba(24, 37, 58, .85); cursor: zoom-in; }
.image_magnify div { width: 100%; height: 100%; background: url('/static/magnifier_focus.png') center/22px no-repeat; }
.listing-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 24px 0 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--muted); font-size: 14px; }
.listing-toolbar > span { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; max-width: 100%; }
.listing-toolbar .pager_current { min-width: 0; max-width: 100%; text-overflow: ellipsis; }
#content_note { grid-column: 1 / -1; padding: 64px 24px; border: 1px dashed #cbd5e4; border-radius: var(--radius); background: var(--surface); color: var(--muted); text-align: center; }
#large_image_container { display: none; position: fixed; inset: 0; z-index: 200; padding: 24px; background: rgba(9, 16, 28, .88); backdrop-filter: blur(8px); cursor: zoom-out; }
#large_image { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); max-width: calc(100% - 48px); max-height: calc(100% - 48px); object-fit: contain; border-radius: 8px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; margin: 34px 16px 0; }
.pager_button, .pager_current, .s_submit, .yesornot button, .status-link { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 9px 17px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: #43516a; font-size: 14px; font-weight: 600; line-height: 1.5; }
.pager_button:hover, .pager_current:hover { color: var(--brand); background: var(--soft-blue); border-color: #a7c6f4; }
.pager_current { width: auto !important; min-width: 76px; max-width: 100%; appearance: none; text-align: center; background: var(--soft-blue); border-color: #bed3f3; color: var(--brand); }
.listing-toolbar .pager_button, .s_submit, .yesornot button, .status-link { background: var(--brand); border-color: var(--brand); color: #fff; }
.listing-toolbar .pager_button:hover, .s_submit:hover, .yesornot button:hover, .status-link:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: #fff; }

/* Detail pages use the same surfaces and fluid player sizing. */
#movie_content { text-align: center; }
#m_title { padding-bottom: 22px; }
#m_title_text { font-size: clamp(21px, 2.1vw, 28px); }
.movie-overview { display: grid; grid-template-columns: 1.1fr 1fr; align-items: start; gap: 28px; margin: 28px 0; text-align: left; }
#m_image { overflow: hidden; border-radius: var(--radius); background: #e7ecf4; }
#m_image img { display: block; width: 100%; height: auto; }
#m_information { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--muted); text-align: left; overflow-wrap: anywhere; }
#m_information > div { margin: 0 0 18px; }
#m_information > div:last-child { margin-bottom: 0; }
#m_information font { color: #43516a; }
#m_information a { display: inline-block; }
#m_actor a, #m_type a, #m_seed_link a { margin: 3px; padding: 4px 10px; border-radius: 6px; background: var(--soft-blue); color: var(--brand); font-size: 13px; }
#m_actor a:hover, #m_type a:hover, #m_seed_link a:hover { background: #dceaff; }
#m_desc { line-height: 1.9; }
.local-movie #m_information { width: 100% !important; margin: 24px 0; }
.player-notice { margin: 20px auto 12px; padding: 10px 16px; border: 1px solid #f2deb6; border-radius: 9px; background: #fff9ee; color: #8b6426; font-size: 14px; text-align: left; }
#m_pc_link { width: 100%; margin: 24px auto !important; }
#m_pc_link > div { width: 100% !important; height: auto !important; margin: 20px auto !important; }
#movie_content .video_frame { display: block; width: 100% !important; max-width: 1000px; height: auto !important; aspect-ratio: 16 / 9; margin: 24px auto !important; overflow: hidden; border: 0; border-radius: var(--radius); background: #0d1420; box-shadow: var(--shadow); }
#movie_content #wrap.video_frame { display: flex !important; align-items: center; justify-content: center; line-height: normal !important; }
#wrap.video_frame > iframe { display: block; width: 100%; height: 100%; border: 0; }
#m_preview_image_container { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 24px 0; }
.m_preview_image { overflow: hidden; border-radius: 9px; }
.m_preview_image img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
#vr_m_image { max-width: 1000px; margin: 26px auto; }
#vr_m_image img { width: 100%; height: auto; border-radius: var(--radius); }
.vr_notice { width: 100%; max-width: 1000px; margin: 24px auto; padding: 22px 24px; border: 1px solid var(--line); border-left: 3px solid var(--brand); border-radius: 10px; background: var(--surface); color: var(--muted); font-size: 14px; text-align: left; overflow-wrap: anywhere; }
.vr_notice > div:first-child { margin-bottom: 10px; color: var(--ink); font-weight: 700; }
.vr_notice br { display: none; }
.vr_notice > div { margin-bottom: 8px; }
#movie_content .content { width: 100%; margin-top: 42px !important; }
#movie_content #content_title_text { font-size: 23px; }

/* Feedback and status pages. */
#s_form { width: 100%; max-width: 760px; margin: 28px auto; padding: 32px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); text-align: left; color: #4b5b73; }
#s_form > div { margin-bottom: 24px; }
#s_form > div:last-child { margin-bottom: 0; text-align: right; }
#s_form label { display: inline-flex; align-items: center; gap: 5px; margin: 8px 10px 0 0; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; cursor: pointer; }
#s_form label:has(input:checked) { background: var(--soft-blue); border-color: #a7c6f4; color: var(--brand); }
.s_content, .s_email, .s_vcode { padding: 11px 13px; border: 1px solid #cbd5e3; border-radius: 8px; background: #fcfdff; color: var(--ink); }
.s_content, .s_email { display: block; width: 100%; margin-top: 10px; }
.s_content { min-height: 190px; resize: vertical !important; }
.s_vcode { width: 110px; margin: 10px 0 0; vertical-align: middle; }
.s_img_vcode { width: 80px; height: 30px; margin: 10px 0 0 12px; cursor: pointer; }
.s_radio { width: 16px; height: 16px; margin: 0; }
.s_submit { min-width: 120px; }
.status-card { width: calc(100% - 40px); max-width: 620px; margin: 70px auto; padding: 48px 30px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); text-align: center; }
.status-symbol { display: flex; align-items: center; justify-content: center; width: 72px; height: 72px; margin: 0 auto 22px; border-radius: 20px; background: var(--soft-blue); color: var(--brand); font-size: 30px; font-weight: 750; }
.status-card h1 { margin: 0 0 12px; font-size: 25px; }
.status-card p { margin: 0 0 25px; color: var(--muted); }
.status-card #counting { color: var(--brand); font-weight: 700; }
.status-page { display: grid; min-height: 100vh; place-items: center; }

/* Partner links share the page grid while keeping their original destinations. */
.ggjav { display: inline-block; color: var(--brand); text-decoration: none; }
.partner-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 3px 18px; margin: 10px 0; text-align: center; font-size: 12px; line-height: 1.5; }
.partner-item { display: flex; align-items: baseline; justify-content: center; flex-wrap: wrap; gap: 0 4px; min-width: 0; max-width: 100%; }
.partner-label { color: #65738a; overflow-wrap: anywhere; }
.partner-actions { display: inline-flex; align-items: baseline; justify-content: center; flex-wrap: wrap; gap: 0 8px; }
.partner-actions .ggjav { font-weight: 600; }
.partner-actions .ggjav:hover { text-decoration: underline; }

/* Keep ad slots and embedded services within the page without changing providers. */
.ads_pc, .ads_mobile, .ads_all { width: 100%; margin: 20px auto; text-align: center; }
.ads_pc { display: none; }
.ads_mobile { display: block; }
.ads_all { display: flex; justify-content: center; align-items: flex-start; flex-wrap: wrap; gap: 12px; }
.ads_all > script, .ads_all > style { display: none; }
.ads_pc iframe, .ads_mobile iframe, .ads_all iframe, .ads_all img { max-width: 100%; border-radius: 6px; }
.ads_pc_rightside { display: none; position: fixed; top: 64px; right: 0; }
.ads_vr { width: 100%; max-width: 500px; margin: 20px auto; }
.ads_vr img { width: 100%; }
#adult_confirmation { position: fixed; inset: 0; z-index: 300; padding: 24px; background: rgba(9, 16, 28, .8); }
#ac_content { width: 100%; max-width: 460px; margin: 15vh auto 0; padding: 32px; border-radius: 16px; background: var(--surface); }
#ac_text { line-height: 1.9; }
.yesornot { display: flex; gap: 10px; margin-top: 24px; }

/* Footer groups existing copy and links into a calmer, readable layout. */
#footer { width: 100%; margin: 64px auto 0; padding: 36px max(24px, calc((100% - 1240px) / 2)) 30px; border-top: 1px solid var(--line); background: #edf1f7; color: #6b788d; font-size: 12px; line-height: 1.9; overflow-wrap: anywhere; }
.footer-main { display: grid; grid-template-columns: 1.35fr 1fr; gap: 36px; }
.footer-copy > div { margin-bottom: 7px; }
.footer-links { display: grid; grid-template-columns: 1fr 1fr; align-content: start; gap: 9px 18px; }
#footer .footer-links > div { margin: 0 !important; color: #6b788d !important; }
#footer a { display: inline; color: #4e6486; }
#footer a:hover { color: var(--brand); text-decoration: underline; }

@media (hover: hover) {
    .movie:not(.native_ads):hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(26, 43, 73, .1); border-color: #becfe7; }
}
/* Match the original large/medium/small styles: desktop banners start at 64em. */
@media (min-width: 64em) {
    .ads_pc, .ads_pc_rightside { display: block; }
    .ads_mobile { display: none; }
}
@media (max-width: 1050px) {
    .header { gap: 18px; }
    .n_name { padding-inline: 10px; font-size: 14px; }
    .search { max-width: 260px; }
    .movie-grid { gap: 20px 16px; }
    .footer-main { grid-template-columns: 1fr; gap: 22px; }
}
@media (max-width: 991px) {
    .movie-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 850px) {
    .header { flex-wrap: wrap; gap: 12px 20px; padding: 16px 24px 0; }
    .n_middle { order: 3; justify-content: space-between; width: 100%; padding: 0 0 12px; }
    .navigator { flex: 1; }
    .search { max-width: 380px; }
    .n_subs { left: 24px; top: calc(100% - 4px); }
    .movie-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .movie-overview { grid-template-columns: 1fr; gap: 20px; }
    #m_image { max-width: 700px; margin: auto; }
    #m_preview_image_container { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 639px) {
    .header { padding: 13px 16px 0; gap: 12px; }
    .title img { width: 96px; }
    .n_name { padding: 8px 4px; font-size: 13px; }
    .n_middle { gap: 3px; padding-bottom: 10px; }
    .n_subs { left: 16px; max-height: calc(100vh - 200px); gap: 4px; }
    .n_col a { padding: 10px 5px; font-size: 12px; }
    .content, #movie_content, #suggestion { width: calc(100% - 32px); margin-top: 26px !important; }
    #content_title, #m_title, #s_title { margin-bottom: 20px; padding-bottom: 16px; }
    .movie-grid { gap: 16px 12px; margin: 22px 0; }
    .movie { border-radius: 10px; }
    .movie > a { padding: 10px 11px; min-height: 66px; font-size: 13px; }
    .movie.native_ads { grid-column: 1 / -1; width: 100%; min-height: 250px; }
    .listing-toolbar { padding: 14px; font-size: 13px; }
    .pager { gap: 6px; }
    .pager_button, .pager_current { padding-inline: 12px; font-size: 13px; }
    #m_information { padding: 20px; }
    #m_preview_image_container { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    #movie_content .video_frame { border-radius: 9px; }
    .vr_notice { padding: 18px; font-size: 13px; }
    #s_form { padding: 22px 18px; }
    #s_form label { margin-right: 5px; font-size: 13px; }
    #footer { margin-top: 42px; padding: 28px 20px; }
    .footer-links { grid-template-columns: 1fr; gap: 8px; }
    .status-card { margin-block: 40px; padding: 36px 22px; }
}
@media (max-width: 699px) {
    .movie.native_ads { grid-column: 1 / -1; min-height: 250px; }
}
@media (max-width: 499px) {
    .search_button { display: block; margin-left: auto; }
    .search { display: none; order: 4; flex: 0 0 100%; max-width: none; margin: 0 0 14px; }
    .search_text { font-size: 16px; }
    .search form { padding-right: 14px; }
    .s_content, .s_email, .s_vcode { font-size: 16px; }
}
@media (max-width: 359px) {
    .content, #movie_content, #suggestion { width: calc(100% - 20px); }
    .movie.native_ads { border: 0; }
    .movie-grid { grid-template-columns: 1fr; }
    .movie > a { min-height: 0; }
    .pager_button, .pager_current { padding-inline: 10px; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
