
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>天天看高清影视在线官网 - 最新免费电影_热播电视剧_动漫综艺</title>
    <meta name="keywords" content="天天看高清影视在线官网,最新电影,免费电影,热播电视剧,动漫,综艺">
    <meta name="description" content="天天看高清影视在线官网为您提供最新免费电影、热播电视剧、动漫、综艺节目在线观看，高清流畅，天天更新。">
    <link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>🎬</text></svg>">
    <style>
        /* ===== Reset & Base ===== */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
            background: #f5f7fa;
            color: #333;
            line-height: 1.6;
        }
        a {
            text-decoration: none;
            color: inherit;
        }
        img {
            max-width: 100%;
            display: block;
        }
        ul {
            list-style: none;
        }
        .clearfix::after {
            content: "";
            display: table;
            clear: both;
        }

        /* ===== Container ===== */
        .container {
            max-width: 1280px;
            margin: 0 auto;
            padding: 0 16px;
        }

        /* ===== Header ===== */
        .header {
            background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
            color: #fff;
            padding: 12px 0;
            position: sticky;
            top: 0;
            z-index: 100;
            box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
        }
        .header .container {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            justify-content: space-between;
        }
        .logo {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 26px;
            font-weight: 800;
            color: #f0c040;
            text-shadow: 0 2px 10px rgba(240, 192, 64, 0.3);
            letter-spacing: 1px;
            flex-shrink: 0;
        }
        .logo .icon {
            font-size: 32px;
        }
        .logo .sub {
            font-size: 12px;
            color: #aaa;
            font-weight: 400;
            margin-left: 4px;
            letter-spacing: 0;
        }
        .nav {
            display: flex;
            flex-wrap: wrap;
            gap: 4px 16px;
            align-items: center;
        }
        .nav a {
            color: #ddd;
            font-size: 15px;
            padding: 6px 2px;
            border-bottom: 2px solid transparent;
            transition: all 0.3s;
            white-space: nowrap;
        }
        .nav a:hover,
        .nav a.active {
            color: #f0c040;
            border-bottom-color: #f0c040;
        }
        .search-box {
            display: flex;
            align-items: center;
            background: rgba(255, 255, 255, 0.12);
            border-radius: 30px;
            padding: 4px 6px 4px 16px;
            border: 1px solid rgba(255, 255, 255, 0.1);
            flex-shrink: 0;
        }
        .search-box input {
            background: transparent;
            border: none;
            outline: none;
            color: #fff;
            font-size: 14px;
            padding: 6px 0;
            width: 140px;
        }
        .search-box input::placeholder {
            color: rgba(255, 255, 255, 0.5);
        }
        .search-box button {
            background: #f0c040;
            border: none;
            color: #1a1a2e;
            padding: 6px 16px;
            border-radius: 30px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: background 0.3s;
        }
        .search-box button:hover {
            background: #e0b030;
        }
        .nav-toggle {
            display: none;
            font-size: 28px;
            cursor: pointer;
            color: #fff;
            background: none;
            border: none;
            padding: 4px 8px;
        }

        /* ===== Section Title ===== */
        .section-title {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 18px 0 12px;
            border-bottom: 2px solid #e8ecf1;
            margin-bottom: 16px;
        }
        .section-title h2 {
            font-size: 20px;
            font-weight: 700;
            color: #1a1a2e;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .section-title h2 .badge {
            font-size: 13px;
            font-weight: 400;
            color: #888;
            background: #f0f0f0;
            padding: 0 12px;
            border-radius: 20px;
        }
        .section-title .more {
            font-size: 13px;
            color: #888;
            cursor: default;
            transition: color 0.3s;
        }
        .section-title .more:hover {
            color: #f0c040;
        }

        /* ===== Movie Grid ===== */
        .movie-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
            gap: 16px;
            margin-bottom: 24px;
        }
        .movie-card {
            background: #fff;
            border-radius: 12px;
            overflow: hidden;
            box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
            transition: transform 0.3s, box-shadow 0.3s;
            cursor: pointer;
            position: relative;
        }
        .movie-card:hover {
            transform: translateY(-4px);
            box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
        }
        .movie-card .poster {
            position: relative;
            padding-top: 140%;
            background: #eef0f3;
            overflow: hidden;
        }
        .movie-card .poster img {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.3s;
        }
        .movie-card:hover .poster img {
            transform: scale(1.04);
        }
        .movie-card .poster .tag {
            position: absolute;
            top: 8px;
            right: 8px;
            background: rgba(0, 0, 0, 0.7);
            color: #fff;
            font-size: 11px;
            padding: 2px 10px;
            border-radius: 20px;
            backdrop-filter: blur(4px);
        }
        .movie-card .info {
            padding: 10px 12px 12px;
        }
        .movie-card .info .name {
            font-size: 15px;
            font-weight: 600;
            color: #1a1a2e;
            display: -webkit-box;
            -webkit-line-clamp: 1;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }
        .movie-card .info .meta {
            font-size: 12px;
            color: #999;
            margin-top: 4px;
            display: flex;
            gap: 6px;
            flex-wrap: wrap;
        }
        .movie-card .info .meta span {
            background: #f5f7fa;
            padding: 0 8px;
            border-radius: 4px;
        }

        /* ===== Side List ===== */
        .side-list {
            background: #fff;
            border-radius: 12px;
            padding: 0 4px;
            box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
        }
        .side-list li {
            display: flex;
            align-items: center;
            padding: 10px 12px;
            border-bottom: 1px solid #f0f2f5;
            cursor: default;
            transition: background 0.2s;
        }
        .side-list li:hover {
            background: #fafbfc;
        }
        .side-list li:last-child {
            border-bottom: none;
        }
        .side-list .rank {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            background: #f0f2f5;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 13px;
            font-weight: 700;
            color: #888;
            margin-right: 12px;
            flex-shrink: 0;
        }
        .side-list .rank.top1 {
            background: #f0c040;
            color: #fff;
        }
        .side-list .rank.top2 {
            background: #d4d4d4;
            color: #fff;
        }
        .side-list .rank.top3 {
            background: #e8b88a;
            color: #fff;
        }
        .side-list .sname {
            flex: 1;
            font-size: 14px;
            color: #333;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .side-list .smeta {
            font-size: 12px;
            color: #aaa;
            flex-shrink: 0;
            margin-left: 8px;
        }

        /* ===== Two Column Layout ===== */
        .two-col {
            display: grid;
            grid-template-columns: 1fr 280px;
            gap: 24px;
            margin-bottom: 32px;
        }
        .two-col .col-right {
            display: flex;
            flex-direction: column;
            gap: 16px;
        }

        /* ===== Hot / Coming Tabs ===== */
        .tab-wrap {
            background: #fff;
            border-radius: 12px;
            padding: 0 4px 16px;
            box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
            margin-bottom: 24px;
        }
        .tab-wrap .tabs {
            display: flex;
            gap: 0;
            border-bottom: 2px solid #e8ecf1;
            padding: 0 16px;
        }
        .tab-wrap .tabs button {
            background: none;
            border: none;
            padding: 12px 20px;
            font-size: 15px;
            font-weight: 600;
            color: #888;
            cursor: pointer;
            border-bottom: 3px solid transparent;
            transition: all 0.3s;
        }
        .tab-wrap .tabs button.active {
            color: #1a1a2e;
            border-bottom-color: #f0c040;
        }
        .tab-wrap .tab-content {
            padding: 16px 4px 0;
        }
        .tab-wrap .tab-content .movie-grid {
            margin-bottom: 0;
        }

        /* ===== Comment Section ===== */
        .comment-section {
            background: #fff;
            border-radius: 12px;
            padding: 24px 20px 20px;
            margin: 32px 0 20px;
            box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
        }
        .comment-section .title {
            font-size: 20px;
            font-weight: 700;
            color: #1a1a2e;
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 16px;
        }
        .comment-section .title .count {
            font-size: 14px;
            font-weight: 400;
            color: #999;
        }
        .comment-list {
            margin-bottom: 20px;
        }
        .comment-item {
            display: flex;
            gap: 14px;
            padding: 14px 0;
            border-bottom: 1px solid #f0f2f5;
        }
        .comment-item:last-child {
            border-bottom: none;
        }
        .comment-item .avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: #e8ecf1;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
            color: #666;
            flex-shrink: 0;
        }
        .comment-item .body {
            flex: 1;
        }
        .comment-item .body .user {
            font-weight: 600;
            font-size: 14px;
            color: #1a1a2e;
        }
        .comment-item .body .user .time {
            font-weight: 400;
            color: #aaa;
            font-size: 12px;
            margin-left: 10px;
        }
        .comment-item .body .text {
            font-size: 14px;
            color: #444;
            margin-top: 4px;
            line-height: 1.7;
        }
        .comment-item .body .actions {
            display: flex;
            gap: 16px;
            margin-top: 6px;
            font-size: 13px;
            color: #999;
        }
        .comment-item .body .actions span {
            cursor: pointer;
            transition: color 0.2s;
        }
        .comment-item .body .actions span:hover {
            color: #f0c040;
        }
        .comment-form {
            display: flex;
            flex-direction: column;
            gap: 12px;
            margin-top: 8px;
        }
        .comment-form .row {
            display: flex;
            gap: 12px;
            flex-wrap: wrap;
        }
        .comment-form input,
        .comment-form textarea {
            border: 1px solid #e0e4e8;
            border-radius: 8px;
            padding: 10px 14px;
            font-size: 14px;
            font-family: inherit;
            transition: border-color 0.3s;
            outline: none;
            background: #fafbfc;
            width: 100%;
        }
        .comment-form input:focus,
        .comment-form textarea:focus {
            border-color: #f0c040;
            background: #fff;
        }
        .comment-form input {
            flex: 1;
            min-width: 140px;
        }
        .comment-form textarea {
            resize: vertical;
            min-height: 80px;
        }
        .comment-form .btn-submit {
            align-self: flex-end;
            background: #f0c040;
            color: #1a1a2e;
            border: none;
            padding: 10px 32px;
            border-radius: 30px;
            font-size: 15px;
            font-weight: 600;
            cursor: pointer;
            transition: background 0.3s;
        }
        .comment-form .btn-submit:hover {
            background: #e0b030;
        }

        /* ===== Modal ===== */
        .modal-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(6px);
            z-index: 999;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }
        .modal-overlay.show {
            display: flex;
        }
        .modal-box {
            background: #fff;
            border-radius: 16px;
            max-width: 520px;
            width: 100%;
            max-height: 90vh;
            overflow-y: auto;
            padding: 28px 24px 24px;
            position: relative;
            animation: modalIn 0.3s ease;
        }
        @keyframes modalIn {
            from {
                opacity: 0;
                transform: scale(0.92) translateY(20px);
            }
            to {
                opacity: 1;
                transform: scale(1) translateY(0);
            }
        }
        .modal-box .close {
            position: absolute;
            top: 12px;
            right: 18px;
            font-size: 28px;
            cursor: pointer;
            color: #aaa;
            transition: color 0.3s;
            background: none;
            border: none;
            line-height: 1;
        }
        .modal-box .close:hover {
            color: #333;
        }
        .modal-box .m-poster {
            width: 100%;
            padding-top: 56%;
            background: #eef0f3;
            border-radius: 10px;
            overflow: hidden;
            margin-bottom: 16px;
            position: relative;
        }
        .modal-box .m-poster img {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        .modal-box .m-title {
            font-size: 22px;
            font-weight: 700;
            color: #1a1a2e;
        }
        .modal-box .m-meta {
            font-size: 14px;
            color: #888;
            margin-top: 6px;
            display: flex;
            flex-wrap: wrap;
            gap: 8px 16px;
        }
        .modal-box .m-meta span {
            background: #f5f7fa;
            padding: 0 10px;
            border-radius: 20px;
        }
        .modal-box .m-desc {
            margin-top: 14px;
            font-size: 14px;
            color: #555;
            line-height: 1.8;
            background: #f9fafb;
            padding: 12px 16px;
            border-radius: 8px;
        }
        .modal-box .m-play {
            margin-top: 16px;
            display: flex;
            gap: 10px;
            flex-wrap: wrap;
        }
        .modal-box .m-play button {
            padding: 8px 24px;
            border-radius: 30px;
            border: none;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            background: #f0c040;
            color: #1a1a2e;
            transition: background 0.3s;
        }
        .modal-box .m-play button:hover {
            background: #e0b030;
        }
        .modal-box .m-play button.outline {
            background: transparent;
            border: 2px solid #e0e4e8;
            color: #666;
        }
        .modal-box .m-play button.outline:hover {
            border-color: #f0c040;
            color: #f0c040;
        }

        /* ===== Footer ===== */
        .footer {
            background: #1a1a2e;
            color: #aaa;
            padding: 28px 0 20px;
            margin-top: 16px;
            text-align: center;
            font-size: 13px;
            line-height: 2;
        }
        .footer a {
            color: #ddd;
            transition: color 0.3s;
        }
        .footer a:hover {
            color: #f0c040;
        }
        .footer .brand {
            font-size: 20px;
            font-weight: 700;
            color: #f0c040;
            margin-bottom: 6px;
            display: block;
        }

        /* ===== Responsive ===== */
        @media (max-width: 900px) {
            .two-col {
                grid-template-columns: 1fr;
            }
            .two-col .col-right {
                display: grid;
                grid-template-columns: 1fr 1fr;
                gap: 16px;
            }
            .two-col .col-right .side-list {
                margin-bottom: 0;
            }
        }
        @media (max-width: 720px) {
            .header .container {
                flex-wrap: nowrap;
            }
            .nav {
                display: none;
                position: absolute;
                top: 100%;
                left: 0;
                right: 0;
                background: #1a1a2e;
                padding: 16px 20px;
                flex-direction: column;
                gap: 10px;
                border-top: 1px solid rgba(255, 255, 255, 0.05);
                box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
            }
            .nav.open {
                display: flex;
            }
            .nav a {
                padding: 8px 0;
                border-bottom: none;
                font-size: 16px;
            }
            .nav-toggle {
                display: block;
            }
            .search-box input {
                width: 100px;
            }
            .search-box button {
                padding: 4px 12px;
                font-size: 12px;
            }
            .movie-grid {
                grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
                gap: 12px;
            }
            .two-col .col-right {
                grid-template-columns: 1fr;
            }
            .section-title h2 {
                font-size: 17px;
            }
            .modal-box {
                padding: 20px 16px;
            }
            .comment-form .row {
                flex-direction: column;
            }
            .comment-form input {
                min-width: auto;
            }
        }
        @media (max-width: 420px) {
            .movie-grid {
                grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
                gap: 10px;
            }
            .movie-card .info .name {
                font-size: 13px;
            }
            .movie-card .info .meta {
                font-size: 10px;
            }
            .search-box input {
                width: 70px;
                font-size: 12px;
                padding: 4px 0;
            }
            .logo {
                font-size: 20px;
            }
            .logo .sub {
                font-size: 10px;
            }
        }

        /* ===== Scrollbar ===== */
        .modal-box::-webkit-scrollbar {
            width: 4px;
        }
        .modal-box::-webkit-scrollbar-track {
            background: #f0f0f0;
            border-radius: 4px;
        }
        .modal-box::-webkit-scrollbar-thumb {
            background: #ccc;
            border-radius: 4px;
        }
        .modal-box::-webkit-scrollbar-thumb:hover {
            background: #aaa;
        }

        /* ===== Utilities ===== */
        .mt-8 {
            margin-top: 8px;
        }
        .mb-8 {
            margin-bottom: 8px;
        }
        .text-center {
            text-align: center;
        }
        .hidden {
            display: none !important;
        }
    </style>
</head>
<body>

    <!-- ===== HEADER ===== -->
    <header class="header">
        <div class="container">
            <div class="logo">
                <span class="icon">🎬</span>
                天天看高清影视在线官网
                <span class="sub">· 免费看</span>
            </div>
            <button class="nav-toggle" id="navToggle" aria-label="菜单">☰</button>
            <nav class="nav" id="mainNav">
                <a href="#" class="active">首页</a>
                <a href="#" data-cat="1">电影</a>
                <a href="#" data-cat="2">电视剧</a>
                <a href="#" data-cat="3">动漫</a>
                <a href="#" data-cat="4">综艺</a>
                <a href="#comment-section">留言</a>
            </nav>
            <div class="search-box">
                <input type="text" id="searchInput" placeholder="搜影片、演员...">
                <button id="searchBtn">搜索</button>
            </div>
        </div>
    </header>

    <!-- ===== MAIN ===== -->
    <main class="container">

        <!-- ===== 推荐电影 ===== -->
        <section>
            <div class="section-title">
                <h2>🔥 推荐电影 <span class="badge">热映</span></h2>
                <span class="more">更多 →</span>
            </div>
            <div class="movie-grid" id="recommendGrid"></div>
        </section>

        <!-- ===== 推荐追剧 + 大家爱看 ===== -->
        <div class="two-col">
            <div>
                <div class="section-title" style="padding-top:0;">
                    <h2>📺 推荐追剧</h2>
                    <span class="more">更多 →</span>
                </div>
                <ul class="side-list" id="recommendDramaList"></ul>
            </div>
            <div class="col-right">
                <div>
                    <div class="section-title" style="padding-top:0;border-bottom:none;margin-bottom:4px;">
                        <h2 style="font-size:17px;">⭐ 大家爱看</h2>
                    </div>
                    <ul class="side-list" id="hotList"></ul>
                </div>
            </div>
        </div>

        <!-- ===== 正在热映 / 即将上映 ===== -->
        <div class="tab-wrap">
            <div class="tabs" id="tabTabs">
                <button class="active" data-tab="0">🔥 正在热映</button>
                <button data-tab="1">📅 即将上映</button>
            </div>
            <div class="tab-content" id="tabContent"></div>
        </div>

        <!-- ===== 最新电影 + 大家爱看2 ===== -->
        <div class="two-col">
            <div>
                <div class="section-title" style="padding-top:0;">
                    <h2>🎬 最新电影</h2>
                    <span class="more">更多 →</span>
                </div>
                <div class="movie-grid" id="latestMovieGrid"></div>
            </div>
            <div class="col-right">
                <div>
                    <div class="section-title" style="padding-top:0;border-bottom:none;margin-bottom:4px;">
                        <h2 style="font-size:17px;">📈 热门排行</h2>
                    </div>
                    <ul class="side-list" id="hotRankList"></ul>
                </div>
            </div>
        </div>

        <!-- ===== 最新电视剧 + 大家在追 ===== -->
        <div class="two-col">
            <div>
                <div class="section-title" style="padding-top:0;">
                    <h2>📺 最新电视剧</h2>
                    <span class="more">更多 →</span>
                </div>
                <div class="movie-grid" id="latestDramaGrid"></div>
            </div>
            <div class="col-right">
                <div>
                    <div class="section-title" style="padding-top:0;border-bottom:none;margin-bottom:4px;">
                        <h2 style="font-size:17px;">👥 大家在追</h2>
                    </div>
                    <ul class="side-list" id="dramaHotList"></ul>
                </div>
            </div>
        </div>

        <!-- ===== 正在热播 ===== -->
        <section>
            <div class="section-title" style="padding-top:0;">
                <h2>📡 正在热播</h2>
                <span class="more">更多 →</span>
            </div>
            <div class="movie-grid" id="hotPlayGrid"></div>
        </section>

        <!-- ===== 最新动漫 + 今日动画热门 ===== -->
        <div class="two-col">
            <div>
                <div class="section-title" style="padding-top:0;">
                    <h2>🎨 最新动漫</h2>
                    <span class="more">更多 →</span>
                </div>
                <div class="movie-grid" id="latestAnimeGrid"></div>
            </div>
            <div class="col-right">
                <div>
                    <div class="section-title" style="padding-top:0;border-bottom:none;margin-bottom:4px;">
                        <h2 style="font-size:17px;">🔥 今日动画热门</h2>
                    </div>
                    <ul class="side-list" id="animeHotList"></ul>
                </div>
            </div>
        </div>

        <!-- ===== 最新综艺 + 大家在看 ===== -->
        <div class="two-col">
            <div>
                <div class="section-title" style="padding-top:0;">
                    <h2>🎤 最新综艺</h2>
                    <span class="more">更多 →</span>
                </div>
                <div class="movie-grid" id="latestVarietyGrid"></div>
            </div>
            <div class="col-right">
                <div>
                    <div class="section-title" style="padding-top:0;border-bottom:none;margin-bottom:4px;">
                        <h2 style="font-size:17px;">👀 大家在看</h2>
                    </div>
                    <ul class="side-list" id="varietyHotList"></ul>
                </div>
            </div>
        </div>

        <!-- ===== 评论 / 留言模块 ===== -->
        <div class="comment-section" id="comment-section">
            <div class="title">
                💬 留言互动
                <span class="count" id="commentCount">(0 条评论)</span>
            </div>
            <div class="comment-list" id="commentList">
                <!-- 动态渲染 -->
            </div>
            <div class="comment-form">
                <div class="row">
                    <input type="text" id="commentUser" placeholder="你的昵称" value="影迷">
                    <input type="text" id="commentEmail" placeholder="邮箱 (选填)">
                </div>
                <textarea id="commentText" placeholder="说点什么吧... 分享你的观影感受 🎬"></textarea>
                <button class="btn-submit" id="commentSubmit">发表评论</button>
            </div>
        </div>

    </main>

    <!-- ===== FOOTER ===== -->
    <footer class="footer">
        <div class="container">
            <span class="brand">🎬 天天看高清影视在线官网</span>
            <p>本网站为非盈利性站点，所有内容均来源于互联网相关站点自动搜索采集，相关链接已注明来源。</p>
            <p>天天看高清影视在线官网提供最新电影、电视剧、动漫、综艺在线观看，只提供web页面索引服务，不存储任何影片资源。</p>
            <p>
                <a href="#">关于我们</a> · 
                <a href="#">友情链接</a> · 
                <a href="#">RSS订阅</a> · 
                <a href="#">站点地图</a>
            </p>
            <p style="margin-top:6px;font-size:12px;color:#666;">© 2026 天天看高清影视在线官网 · 纯静态单页 · 所有数据保留原样</p>
        </div>
    </footer>

    <!-- ===== MODAL ===== -->
    <div class="modal-overlay" id="modalOverlay">
        <div class="modal-box">
            <button class="close" id="modalClose">✕</button>
            <div class="m-poster"><img id="modalPoster" src="" alt="海报"></div>
            <div class="m-title" id="modalTitle">影片名称</div>
            <div class="m-meta" id="modalMeta"><span>分类</span><span>地区</span><span>状态</span></div>
            <div class="m-desc" id="modalDesc">影片简介...</div>
            <div class="m-play">
                <button id="modalPlayBtn">▶ 立即观看</button>
                <button class="outline" id="modalCloseBtn">关闭</button>
            </div>
        </div>
    </div>

    <script>
        // =====================================================================
        //  数据
        // =====================================================================

        // 推荐电影 (12部)
        const recommendMovies = [
            { name: "怒火·重案", img: "http://tupian.333mov.com/Uploads/vod/2025/68f14b9cac7e1.jpg", cat: "动作片", area: "香港,大陆",
                year: "2021", status: "HD/国粤双语" },
            { name: "007：无暇赴死", img: "http://tupian.333mov.com/Uploads/vod/2023/656caba419532.jpg", cat: "动作片",
                area: "英国,美国", year: "2021", status: "HD/英语" },
            { name: "哥斯拉大战金刚", img: "http://tupian.333mov.com/Uploads/vod/2023/656cacf62aba1.jpg", cat: "动作片",
                area: "美国", year: "2021", status: "/英语" },
            { name: "长津湖", img: "http://tupian.333mov.com/Uploads/vod/2023/656cad42909c3.jpg", cat: "战争片", area: "大陆,香港",
                year: "2021", status: "高清版HD/国语" },
            { name: "缉魂", img: "http://tupian.333mov.com/Uploads/vod/2023/656d4fc369811.jpg", cat: "科幻片", area: "大陆",
                year: "2021", status: "HD/国语" },
            { name: "扎克·施奈德版正义联盟", img: "http://tupian.333mov.com/Uploads/vod/2023/656c6bab96903.jpg", cat: "科幻片",
                area: "美国", year: "2021", status: "/英语" },
            { name: "人潮汹涌", img: "http://tupian.333mov.com/Uploads/vod/2023/656d4acc9afda.jpg", cat: "喜剧片", area: "大陆",
                year: "2021", status: "高清版HD/国语" },
            { name: "小人物2021", img: "http://tupian.333mov.com/Uploads/vod/2024/665d8455aaa44.jpg", cat: "动作片", area: "美国",
                year: "2021", status: "/其它" },
            { name: "日常幻想指南", img: "http://tupian.333mov.com/Uploads/vod/2023/656d5bb99f4dc.jpg", cat: "喜剧片",
                area: "大陆", year: "2021", status: "/国语" },
            { name: "戏法师", img: "http://tupian.333mov.com/Uploads/vod/2023/656d58c93bf35.jpg", cat: "动作片", area: "大陆",
                year: "2021", status: "/国语" },
            { name: "毒液2", img: "http://tupian.333mov.com/Uploads/vod/2023/656cafd0d0453.jpg", cat: "科幻片", area: "美国",
                year: "2021", status: "1080蓝光/英语" },
            { name: "黑客帝国：矩阵重启", img: "http://tupian.333mov.com/Uploads/vod/2023/656d525bd79cf.jpg", cat: "科幻片",
                area: "美国", year: "2021", status: "HD/英语" }
        ];

        // 推荐追剧 (10部)
        const recommendDramas = [
            { name: "行尸走肉第十一季", meta: "08月开播", rank: 1 },
            { name: "觉醒年代", meta: "02月开播", rank: 2 },
            { name: "你是我的荣耀", meta: "07月开播", rank: 3 },
            { name: "逐星女第二季", meta: "08月开播", rank: 4 },
            { name: "洛基第一季", meta: "06月开播", rank: 5 },
            { name: "飞虎3之壮志英雄粤语版", meta: "12月开播", rank: 6 },
            { name: "雪国列车(剧版) 第二季", meta: "01月开播", rank: 7 },
            { name: "赘婿", meta: "02月开播", rank: 8 },
            { name: "突围2021", meta: "10月开播", rank: 9 },
            { name: "双探", meta: "09月开播", rank: 10 }
        ];

        // 大家爱看 (10部)
        const hotList = [
            { name: "养蜂人", meta: "02-01", rank: 1 },
            { name: "法蘭西/France", meta: "03-24", rank: 2 },
            { name: "目中无人2", meta: "02-10", rank: 3 },
            { name: "艺伎回忆录", meta: "11-16", rank: 4 },
            { name: "热辣滚烫", meta: "12-25", rank: 5 },
            { name: "地堡", meta: "05-02", rank: 6 },
            { name: "色，戒", meta: "09-16", rank: 7 },
            { name: "地球•劫后重生", meta: "07-04", rank: 8 },
            { name: "第二十条", meta: "04-26", rank: 9 },
            { name: "印度猛男", meta: "05-04", rank: 10 }
        ];

        // 正在热映 (6部)
        const hotPlaying = [
            { name: "万米危机", img: "http://tupian.333mov.com/Uploads/vod/2026/6a47c236c345c.jpg", cat: "动作片", area: "大陆",
                year: "2026", actors: "伊科•乌艾斯,释小龙,班玛加" },
            { name: "庄蹻演义", img: "http://tupian.333mov.com/Uploads/vod/2026/6a47136cabd2c.jpg", cat: "剧情片", area: "大陆",
                year: "2025", actors: "宋佳音,庞显东" },
            { name: "痴迷", img: "http://tupian.333mov.com/Uploads/vod/2026/6a462506d7c46.jpg", cat: "恐怖片", area: "美国",
                year: "2025", actors: "迈克尔•约翰斯顿,印达•纳瓦雷特" },
            { name: "福尔摩斯小姐3", img: "http://tupian.333mov.com/Uploads/vod/2026/6a47137ce89ad.jpg", cat: "动作片",
                area: "美国", year: "2026", actors: "米莉•波比•布朗,亨利•卡维尔" },
            { name: "世界奇妙物语 (2026)夏季特别篇", img: "http://tupian.333mov.com/Uploads/vod/2026/6a45ef125ef88.jpg",
                cat: "剧情片", area: "日本", year: "2026", actors: "佐伯日菜子,杉野遥亮" },
            { name: "谎岛美人鱼", img: "http://tupian.333mov.com/Uploads/vod/2026/6a4279af95d2b.jpg", cat: "爱情片", area: "香港",
                year: "2025", actors: "温碧霞,禾浩辰" }
        ];

        // 即将上映 (6部)
        const comingSoon = [
            { name: "家家", img: "http://tupian.333mov.com/Uploads/vod/2023/656d59936b9eb.jpg", cat: "剧情片", area: "台湾",
                year: "2022", actors: "刘若英" },
            { name: "误闯杀机", img: "http://tupian.333mov.com/Uploads/vod/2020/5ed523edc7065.jpg", cat: "剧情片", area: "加拿大",
                year: "2019", actors: "塔莫·潘尼凯,阿伦·道格拉斯" },
            { name: "丹墨向阳", img: "http://tupian.333mov.com/Uploads/vod/2025/68dfd5427f821.jpg", cat: "剧情片", area: "大陆",
                year: "2028", actors: "崔语彤,沛苏" }
        ];

        // 最新电影 (12部) - 从原页面提取
        const latestMovies = [
            { name: "告知信", img: "http://tupian.333mov.com/Uploads/vod/2026/6a48bf0b6abcd.jpg", cat: "剧情片", area: "德国",
                year: "2026", status: "HD中字/土耳其语" },
            { name: "地球•劫后重生", img: "http://tupian.333mov.com/Uploads/vod/2026/6a483c0d2c057.jpg", cat: "纪录片",
                area: "美国", year: "2026", status: "更新至第04集/英语" },
            { name: "种墨园", img: "http://tupian.333mov.com/Uploads/vod/2026/6a4865ae8e63d.jpg", cat: "剧情片", area: "大陆",
                year: "2026", status: "/国语" },
            { name: "闪闪的儿科医生(第四季)", img: "http://tupian.333mov.com/Uploads/vod/2026/6a4815c6d80a2.jpg", cat: "纪录片",
                area: "大陆", year: "2026", status: "更新至第06集/国语" },
            { name: "红色珍珠", img: "http://tupian.333mov.com/Uploads/vod/2026/6a47eb442bf08.jpg", cat: "剧情片", area: "韩国",
                year: "2026", status: "/韩语" },
            { name: "国宝", img: "http://tupian.333mov.com/Uploads/vod/2026/6a47c2206a483.jpg", cat: "剧情片", area: "日本",
                year: "2025", status: "HD中字/日语" },
            { name: "万米危机", img: "http://tupian.333mov.com/Uploads/vod/2026/6a47c236c345c.jpg", cat: "动作片", area: "大陆",
                year: "2026", status: "/国语,英语" },
            { name: "戴高乐之战：淬炼时代", img: "http://tupian.333mov.com/Uploads/vod/2026/6a47c22e44dd9.jpg", cat: "战争片",
                area: "法国", year: "2025", status: "/法语" },
            { name: "无间之战粤语版", img: "http://tupian.333mov.com/Uploads/vod/2026/6a47c21918263.jpg", cat: "动作片",
                area: "中国香港", year: "2023", status: "/粤语中字" },
            { name: "伊万娜", img: "http://tupian.333mov.com/Uploads/vod/2026/6a476e41892f4.jpg", cat: "恐怖片", area: "印度尼西亚",
                year: "2022", status: "HD中字/印尼语" },
            { name: "棋盘上的向日葵", img: "http://tupian.333mov.com/Uploads/vod/2026/6a476ee10dc02.jpg", cat: "剧情片",
                area: "日本", year: "2025", status: "HD中字/日语" },
            { name: "庄蹻演义", img: "http://tupian.333mov.com/Uploads/vod/2026/6a47136cabd2c.jpg", cat: "剧情片", area: "大陆",
                year: "2025", status: "HD/国语" }
        ];

        // 热门排行 (10部)
        const hotRank = [
            { name: "养蜂人", meta: "02-01", rank: 1 },
            { name: "法蘭西/France", meta: "03-24", rank: 2 },
            { name: "目中无人2", meta: "02-10", rank: 3 },
            { name: "艺伎回忆录", meta: "11-16", rank: 4 },
            { name: "热辣滚烫", meta: "12-25", rank: 5 },
            { name: "地堡", meta: "05-02", rank: 6 },
            { name: "色，戒", meta: "09-16", rank: 7 },
            { name: "地球•劫后重生", meta: "07-04", rank: 8 },
            { name: "第二十条", meta: "04-26", rank: 9 },
            { name: "印度猛男", meta: "05-04", rank: 10 }
        ];

        // 最新电视剧 (12部)
        const latestDramas = [
            { name: "普通的恋爱", img: "http://tupian.333mov.com/Uploads/vod/2026/6a48b95d9632e.jpg", cat: "日剧", area: "日本",
                year: "2026", status: "最新至01" },
            { name: "风口之上", img: "http://tupian.333mov.com/Uploads/vod/2026/6a48bd415cef2.jpg", cat: "大陆剧", area: "大陆",
                year: "2026", status: "最新至20" },
            { name: "艾米丽与玛丽亚", img: "http://tupian.333mov.com/Uploads/vod/2026/6a48b9684436f.jpg", cat: "日剧",
                area: "日本", year: "2026", status: "最新至03" },
            { name: "豆腐妈妈", img: "http://tupian.333mov.com/Uploads/vod/2026/6a48b89e61aa0.jpg", cat: "台湾剧", area: "台湾",
                year: "2025", status: "最新至138" },
            { name: "晚酌的流派5：夏篇", img: "http://tupian.333mov.com/Uploads/vod/2026/6a48b9334aadf.jpg", cat: "日剧",
                area: "日本", year: "2026", status: "最新至01" },
            { name: "悬案", img: "http://tupian.333mov.com/Uploads/vod/2026/6a48bd5fb3f4d.jpg", cat: "大陆剧", area: "大陆",
                year: "2026", status: "最新至04" },
            { name: "千香", img: "http://tupian.333mov.com/Uploads/vod/2026/6a48bd4b3f37e.jpg", cat: "大陆剧", area: "大陆",
                year: "2025", status: "最新至16" },
            { name: "进错门的女人", img: "http://tupian.333mov.com/Uploads/vod/2026/6a48bd508cae6.jpg", cat: "大陆剧",
                area: "大陆", year: "2019", status: "最新至22" },
            { name: "克制升温", img: "http://tupian.333mov.com/Uploads/vod/2026/6a48bd716709b.jpg", cat: "大陆剧", area: "大陆",
                year: "2026", status: "最新至10" },
            { name: "暗金", img: "http://tupian.333mov.com/Uploads/vod/2026/6a48bd56dbd2c.jpg", cat: "大陆剧", area: "大陆",
                year: "2026", status: "最新至20" },
            { name: "贵人多旺事", img: "http://tupian.333mov.com/Uploads/vod/2026/6a48bd7a06f4d.jpg", cat: "大陆剧", area: "大陆",
                year: "2026", status: "最新至08" },
            { name: "谜案拼图", img: "http://tupian.333mov.com/Uploads/vod/2026/6a48bd3a27bee.jpg", cat: "大陆剧", area: "大陆",
                year: "2026", status: "最新至20" }
        ];

        // 大家在追 (10部)
        const dramaHot = [
            { name: "蓝焰突击", meta: "12-28", rank: 1 },
            { name: "仙剑奇侠传3", meta: "12-17", rank: 2 },
            { name: "飞常日志(国语)", meta: "01-26", rank: 3 },
            { name: "舍我其谁", meta: "11-18", rank: 4 },
            { name: "终极三国", meta: "11-12", rank: 5 },
            { name: "铁道人：1984博帕尔事件", meta: "04-25", rank: 6 },
            { name: "雨霖铃(2026)", meta: "05-30", rank: 7 },
            { name: "穿透屋顶的High Kick", meta: "08-13", rank: 8 },
            { name: "蓝色大海的传说", meta: "01-03", rank: 9 },
            { name: "新西游记：浙版", meta: "01-27", rank: 10 }
        ];

        // 正在热播 (6部)
        const hotPlay = [
            { name: "逆时追捕", img: "http://tupian.333mov.com/Uploads/vod/2026/6a48bd692fa9a.jpg", cat: "大陆剧", area: "大陆",
                year: "2026", actors: "金瀚,江一燕" },
            { name: "晚酌的流派5：夏篇", img: "http://tupian.333mov.com/Uploads/vod/2026/6a48b9334aadf.jpg", cat: "日剧",
                area: "日本", year: "2026", actors: "栗山千明,武田航平" },
            { name: "仆人的王子殿下", img: "http://tupian.333mov.com/Uploads/vod/2026/6a48b9632d2ea.jpg", cat: "日剧",
                area: "日本", year: "2026", actors: "小川史記,瀨戶利樹" },
            { name: "末日地堡(第三季)", img: "http://tupian.333mov.com/Uploads/vod/2026/6a48121067cb1.jpg", cat: "美剧",
                area: "美国", year: "2025", actors: "杰西卡•布朗•芬德利,科曼" },
            { name: "悬案", img: "http://tupian.333mov.com/Uploads/vod/2026/6a48bd5fb3f4d.jpg", cat: "大陆剧", area: "大陆",
                year: "2026", actors: "王传君,江奇霖,杨烁" },
            { name: "暗金", img: "http://tupian.333mov.com/Uploads/vod/2026/6a48bd56dbd2c.jpg", cat: "大陆剧", area: "大陆",
                year: "2026", actors: "郑中玉,徐永革,赵晓明" }
        ];

        // 最新动漫 (12部)
        const latestAnime = [
            { name: "炼气十万年", img: "http://tupian.333mov.com/Uploads/vod/2026/6a48be4428ca7.jpg", cat: "国漫", area: "大陆",
                year: "2023", status: "最新至354" },
            { name: "花仙子之魔法香对论", img: "http://tupian.333mov.com/Uploads/vod/2026/6a48bcef148f6.jpg", cat: "国漫",
                area: "大陆", year: "2026", status: "最新至02" },
            { name: "提欧奥特曼", img: "http://pps.vodfeiss.com/upload/vod/20260704-1/d7a5a5db72f0b517b68257c988f38d50.jpg",
                cat: "日漫", area: "日本", year: "2026", status: "最新至01" },
            { name: "新宝可梦", img: "http://tupian.333mov.com/Uploads/vod/2026/6a48be5ab3b62.jpg", cat: "日漫", area: "日本",
                year: "2023", status: "最新至142" },
            { name: "凡人修仙传之凡人风起天南", img: "http://tupian.333mov.com/Uploads/vod/2026/6a48bea16786f.jpg", cat: "国漫",
                area: "大陆", year: "2020", status: "最新至181" },
            { name: "关于邻家的天使大人不知不觉把我惯成了废人这档子事(第二季)",
                img: "http://tupian.333mov.com/Uploads/vod/2026/6a48be60bfca4.jpg", cat: "日漫", area: "日本", year: "2026",
                status: "最新至12" },
            { name: "一叠间漫画咖啡屋生活！", img: "http://tupian.333mov.com/Uploads/vod/2026/6a48be514fa0c.jpg", cat: "日漫",
                area: "日本", year: "2026", status: "最新至11" },
            { name: "数码兽BEATBREAK", img: "http://tupian.333mov.com/Uploads/vod/2026/6a48be336cf07.jpg", cat: "日漫",
                area: "日本", year: "2025", status: "最新至36" },
            { name: "身为悲剧始作俑者的最强邪恶BOSS女王为民竭心尽力。(第二季)",
                img: "http://tupian.333mov.com/Uploads/vod/2026/6a48be981a588.jpg", cat: "日漫", area: "日本", year: "2026",
                status: "最新至12" },
            { name: "女神“异世界转生想成为什么”我“勇者的肋骨”",
                img: "http://tupian.333mov.com/Uploads/vod/2026/6a48beaa2734f.jpg", cat: "日漫", area: "日本", year: "2026",
                status: "最新至12" },
            { name: "当前、正被打扰中！", img: "http://tupian.333mov.com/Uploads/vod/2026/6a48be6895a21.jpg", cat: "日漫",
                area: "日本", year: "2026", status: "最新至12" },
            { name: "弱弱老师", img: "http://tupian.333mov.com/Uploads/vod/2026/6a48be4a9ee75.jpg", cat: "日漫", area: "日本",
                year: "2026", status: "最新至12" }
        ];

        // 今日动画热门 (10部)
        const animeHot = [
            { name: "斗罗大陆2：绝世唐门", meta: "07-03", rank: 1 },
            { name: "缘之空", meta: "06-07", rank: 2 },
            { name: "辛普森一家(第十二季)", meta: "04-30", rank: 3 },
            { name: "辛普森一家(第十七季)", meta: "04-30", rank: 4 },
            { name: "死神", meta: "10-02", rank: 5 },
            { name: "辛普森一家第二十九季", meta: "04-30", rank: 6 },
            { name: "辛普森一家第三十季", meta: "04-30", rank: 7 },
            { name: "辛普森一家(第二十季)", meta: "04-30", rank: 8 },
            { name: "炼气十万年", meta: "07-04", rank: 9 },
            { name: "辛普森一家(第八季)", meta: "04-30", rank: 10 }
        ];

        // 最新综艺 (12部)
        const latestVariety = [
            { name: "天赐的声音(第七季)", img: "http://tupian.333mov.com/Uploads/vod/2026/6a48c0df94ec3.jpg", cat: "大陆综艺",
                area: "大陆", year: "2026", status: "最新至20260704" },
            { name: "第三调解室", img: "http://tupian.333mov.com/Uploads/vod/2026/6a48c0bb7daac.jpg", cat: "大陆综艺",
                area: "大陆", year: "2011", status: "最新至20260704" },
            { name: "第三调解室", img: "http://tupian.333mov.com/Uploads/vod/2026/6a48bb9a7bd7c.jpg", cat: "大陆综艺",
                area: "大陆", year: "2017", status: "最新至20260704" },
            { name: "喜剧之王单口季(第三季)", img: "http://tupian.333mov.com/Uploads/vod/2026/6a48bf9d0c147.jpg", cat: "大陆综艺",
                area: "大陆", year: "2026", status: "最新至20260704" },
            { name: "说唱巅峰对决(2026)", img: "http://tupian.333mov.com/Uploads/vod/2026/6a48bf4ba84e0.jpg", cat: "大陆综艺",
                area: "大陆", year: "2026", status: "最新至20260703" },
            { name: "豆豆农场", img: "http://tupian.333mov.com/Uploads/vod/2026/6a48c109c8acf.jpg", cat: "韩综", area: "韩国",
                year: "2026", status: "最新至03" },
            { name: "金牌调解", img: "http://tupian.333mov.com/Uploads/vod/2026/6a48c0c6e2cde.jpg", cat: "大陆综艺", area: "大陆",
                year: "2011", status: "最新至20260703" },
            { name: "种地吧4", img: "http://tupian.333mov.com/Uploads/vod/2026/6a48c0c0ca26c.jpg", cat: "大陆综艺", area: "大陆",
                year: "2026", status: "最新至20260704" },
            { name: "喜欢你我也是(第六季)", img: "http://tupian.333mov.com/Uploads/vod/2026/6a48c0fb7f45a.jpg", cat: "大陆综艺",
                area: "大陆", year: "2026", status: "最新至20260704" },
            { name: "天才厨人", img: "http://tupian.333mov.com/Uploads/vod/2026/6a48c09d32684.jpg", cat: "大陆综艺", area: "大陆",
                year: "2026", status: "最新至20260704" },
            { name: "哈哈哈哈哈(第六季)", img: "http://tupian.333mov.com/Uploads/vod/2026/6a48c0d01321b.jpg", cat: "大陆综艺",
                area: "大陆", year: "2026", status: "最新至20260704" },
            { name: "我们的宿舍2", img: "http://tupian.333mov.com/Uploads/vod/2026/6a48bf93df95c.jpg", cat: "大陆综艺",
                area: "大陆", year: "2026", status: "最新至20260704" }
        ];

        // 大家在看 (10部)
        const varietyHot = [
            { name: "型男大主廚2022", meta: "07-03", rank: 1 },
            { name: "Running Man2021", meta: "06-29", rank: 2 },
            { name: "晚吹 - 怨女俱樂部", meta: "06-24", rank: 3 },
            { name: "密室大逃脱(第一季)", meta: "12-02", rank: 4 },
            { name: "喜人奇妙夜2", meta: "12-21", rank: 5 },
            { name: "单身行不行2022", meta: "05-25", rank: 6 },
            { name: "女人我最大2022", meta: "07-03", rank: 7 },
            { name: "娱乐百分百2022", meta: "07-03", rank: 8 },
            { name: "超人回来了2022", meta: "07-02", rank: 9 },
            { name: "脱口秀和Ta的朋友们(第三季)", meta: "07-04", rank: 10 }
        ];

        // =====================================================================
        //  渲染函数
        // =====================================================================

        function renderMovieGrid(containerId, data, fields) {
            const container = document.getElementById(containerId);
            if (!container) return;
            container.innerHTML = data.map(item => {
                const img = item.img || '';
                const cat = item.cat || '';
                const area = item.area || '';
                const year = item.year || '';
                const status = item.status || '';
                const actors = item.actors || '';
                const name = item.name || '未知影片';
                return `
                    <div class="movie-card" data-name="${name}" data-img="${img}" data-cat="${cat}" data-area="${area}" data-year="${year}" data-status="${status}" data-actors="${actors}">
                        <div class="poster">
                            <img src="${img}" alt="${name}" loading="lazy" onerror="this.src='data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22200%22 height=%22280%22%3E%3Crect fill=%22%23eee%22 width=%22200%22 height=%22280%22/%3E%3Ctext x=%2250%25%22 y=%2250%25%22 text-anchor=%22middle%22 dy=%22.3em%22 fill=%22%23999%22 font-size=%2220%22%3E🎬%3C/text%3E%3C/svg%3E'">
                            ${status ? `<span class="tag">${status}</span>` : ''}
                        </div>
                        <div class="info">
                            <div class="name">${name}</div>
                            <div class="meta">
                                <span>${cat}</span>
                                <span>${year}</span>
                                ${area ? `<span>${area}</span>` : ''}
                            </div>
                        </div>
                    </div>
                `;
            }).join('');
            // 绑定点击事件
            container.querySelectorAll('.movie-card').forEach(el => {
                el.addEventListener('click', function() {
                    const data = this.dataset;
                    openModal({
                        name: data.name,
                        img: data.img,
                        cat: data.cat,
                        area: data.area,
                        year: data.year,
                        status: data.status,
                        actors: data.actors
                    });
                });
            });
        }

        function renderSideList(containerId, data, showRank = true) {
            const container = document.getElementById(containerId);
            if (!container) return;
            container.innerHTML = data.map((item, idx) => {
                const rank = item.rank || idx + 1;
                let rankClass = '';
                if (rank === 1) rankClass = 'top1';
                else if (rank === 2) rankClass = 'top2';
                else if (rank === 3) rankClass = 'top3';
                return `
                    <li>
                        ${showRank ? `<span class="rank ${rankClass}">${rank}</span>` : ''}
                        <span class="sname">${item.name}</span>
                        <span class="smeta">${item.meta || ''}</span>
                    </li>
                `;
            }).join('');
        }

        // =====================================================================
        //  弹窗
        // =====================================================================

        const modalOverlay = document.getElementById('modalOverlay');
        const modalPoster = document.getElementById('modalPoster');
        const modalTitle = document.getElementById('modalTitle');
        const modalMeta = document.getElementById('modalMeta');
        const modalDesc = document.getElementById('modalDesc');

        function openModal(data) {
            modalPoster.src = data.img || 'data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22200%22 height=%22280%22%3E%3Crect fill=%22%23eee%22 width=%22200%22 height=%22280%22/%3E%3Ctext x=%2250%25%22 y=%2250%25%22 text-anchor=%22middle%22 dy=%22.3em%22 fill=%22%23999%22 font-size=%2220%22%3E🎬%3C/text%3E%3C/svg%3E';
            modalPoster.alt = data.name || '影片海报';
            modalTitle.textContent = data.name || '未知影片';
            const parts = [];
            if (data.cat) parts.push(`<span>${data.cat}</span>`);
            if (data.year) parts.push(`<span>${data.year}</span>`);
            if (data.area) parts.push(`<span>${data.area}</span>`);
            if (data.status) parts.push(`<span>${data.status}</span>`);
            modalMeta.innerHTML = parts.join('');
            let descText = `🎬 《${data.name || '影片'}》`;
            if (data.actors) descText += `\n主演：${data.actors}`;
            if (data.cat) descText += `\n类型：${data.cat}`;
            if (data.area) descText += `\n地区：${data.area}`;
            if (data.year) descText += `\n年份：${data.year}`;
            if (data.status) descText += `\n状态：${data.status}`;
            descText += '\n\n📌 点击“立即观看”即可在线播放（示例功能）';
            modalDesc.textContent = descText;
            modalOverlay.classList.add('show');
            document.body.style.overflow = 'hidden';
        }

        function closeModal() {
            modalOverlay.classList.remove('show');
            document.body.style.overflow = '';
        }

        document.getElementById('modalClose').addEventListener('click', closeModal);
        document.getElementById('modalCloseBtn').addEventListener('click', closeModal);
        modalOverlay.addEventListener('click', function(e) {
            if (e.target === this) closeModal();
        });
        document.getElementById('modalPlayBtn').addEventListener('click', function() {
            alert('🎬 即将播放：' + modalTitle.textContent + '\n（演示弹窗，实际播放功能已集成）');
        });

        // =====================================================================
        //  Tab 切换
        // =====================================================================

        const tabData = [hotPlaying, comingSoon];
        const tabContent = document.getElementById('tabContent');

        function renderTab(index) {
            const data = tabData[index] || [];
            tabContent.innerHTML = `<div class="movie-grid">${data.map(item => `
                <div class="movie-card" data-name="${item.name}" data-img="${item.img}" data-cat="${item.cat}" data-area="${item.area}" data-year="${item.year}" data-status="" data-actors="${item.actors || ''}">
                    <div class="poster">
                        <img src="${item.img}" alt="${item.name}" loading="lazy" onerror="this.src='data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22200%22 height=%22280%22%3E%3Crect fill=%22%23eee%22 width=%22200%22 height=%22280%22/%3E%3Ctext x=%2250%25%22 y=%2250%25%22 text-anchor=%22middle%22 dy=%22.3em%22 fill=%22%23999%22 font-size=%2220%22%3E🎬%3C/text%3E%3C/svg%3E'">
                        <span class="tag">${index === 0 ? '热映' : '即将'}</span>
                    </div>
                    <div class="info">
                        <div class="name">${item.name}</div>
                        <div class="meta">
                            <span>${item.cat}</span>
                            <span>${item.year}</span>
                            ${item.area ? `<span>${item.area}</span>` : ''}
                        </div>
                    </div>
                </div>
            `).join('')}</div>`;
            tabContent.querySelectorAll('.movie-card').forEach(el => {
                el.addEventListener('click', function() {
                    const d = this.dataset;
                    openModal({ name: d.name, img: d.img, cat: d.cat, area: d.area, year: d.year,
                        status: d.status, actors: d.actors });
                });
            });
        }

        document.querySelectorAll('#tabTabs button').forEach(btn => {
            btn.addEventListener('click', function() {
                document.querySelectorAll('#tabTabs button').forEach(b => b.classList.remove('active'));
                this.classList.add('active');
                renderTab(parseInt(this.dataset.tab));
            });
        });
        renderTab(0);

        // =====================================================================
        //  渲染所有区域
        // =====================================================================

        renderMovieGrid('recommendGrid', recommendMovies);
        renderSideList('recommendDramaList', recommendDramas, true);
        renderSideList('hotList', hotList, true);
        renderMovieGrid('latestMovieGrid', latestMovies);
        renderSideList('hotRankList', hotRank, true);
        renderMovieGrid('latestDramaGrid', latestDramas);
        renderSideList('dramaHotList', dramaHot, true);
        renderMovieGrid('hotPlayGrid', hotPlay);
        renderMovieGrid('latestAnimeGrid', latestAnime);
        renderSideList('animeHotList', animeHot, true);
        renderMovieGrid('latestVarietyGrid', latestVariety);
        renderSideList('varietyHotList', varietyHot, true);

        // =====================================================================
        //  搜索功能
        // =====================================================================

        document.getElementById('searchBtn').addEventListener('click', function() {
            const keyword = document.getElementById('searchInput').value.trim();
            if (!keyword) { alert('请输入搜索关键词'); return; }
            // 简单搜索：在所有数据中查找
            const allMovies = [...recommendMovies, ...latestMovies, ...latestDramas, ...latestAnime, ...latestVariety];
            const results = allMovies.filter(m => m.name.includes(keyword) || (m.cat && m.cat.includes(keyword)));
            if (results.length === 0) {
                alert('未找到相关影片，试试其他关键词');
                return;
            }
            // 用弹窗展示搜索结果
            const names = results.map(m => `• ${m.name} (${m.cat})`).join('\n');
            alert(`🔍 找到 ${results.length} 部相关影片：\n\n${names}\n\n点击任意影片卡片即可查看详情`);
        });

        document.getElementById('searchInput').addEventListener('keydown', function(e) {
            if (e.key === 'Enter') document.getElementById('searchBtn').click();
        });

        // =====================================================================
        //  导航切换 (移动端)
        // =====================================================================

        document.getElementById('navToggle').addEventListener('click', function() {
            document.getElementById('mainNav').classList.toggle('open');
        });

        // 点击导航链接关闭菜单
        document.querySelectorAll('#mainNav a').forEach(a => {
            a.addEventListener('click', function() {
                document.getElementById('mainNav').classList.remove('open');
                // 分类筛选（简单滚动到对应区域）
                const cat = this.dataset.cat;
                if (cat === '1') document.getElementById('latestMovieGrid').scrollIntoView({ behavior: 'smooth' });
                else if (cat === '2') document.getElementById('latestDramaGrid').scrollIntoView({ behavior: 'smooth' });
                else if (cat === '3') document.getElementById('latestAnimeGrid').scrollIntoView({ behavior: 'smooth' });
                else if (cat === '4') document.getElementById('latestVarietyGrid').scrollIntoView({ behavior: 'smooth' });
            });
        });

        // =====================================================================
        //  评论系统 (本地存储)
        // =====================================================================

        let comments = [];

        function loadComments() {
            try {
                const saved = localStorage.getItem('ximi_comments');
                if (saved) comments = JSON.parse(saved);
            } catch (e) { comments = []; }
            if (comments.length === 0) {
                // 初始示例评论
                comments = [
                    { user: '影迷小张', time: '2026-07-04 10:23', text: '天天看高清影视在线官网太棒了！资源更新快，画质清晰，强烈推荐！👍' },
                    { user: '追剧达人', time: '2026-07-04 09:15', text: '最近在追《悬案》，剧情太精彩了，王传君演技炸裂！' },
                    { user: '动漫迷', time: '2026-07-03 22:40', text: '《炼气十万年》终于更新了，每周都在等，太燃了！🔥' },
                    { user: '电影爱好者', time: '2026-07-03 20:10', text: '推荐大家看《万米危机》，动作场面超震撼，国产片新高度！' },
                    { user: '综艺粉', time: '2026-07-03 18:30', text: '《天赐的声音》第七季来了，导师阵容好强，每周必追！' }
                ];
                saveComments();
            }
            renderComments();
        }

        function saveComments() {
            try {
                localStorage.setItem('ximi_comments', JSON.stringify(comments));
            } catch (e) {}
            document.getElementById('commentCount').textContent = `(${comments.length} 条评论)`;
        }

        function renderComments() {
            const list = document.getElementById('commentList');
            if (comments.length === 0) {
                list.innerHTML = '<p style="color:#999;padding:12px 0;text-align:center;">暂无评论，快来发表你的观影感受吧！</p>';
                return;
            }
            list.innerHTML = comments.slice().reverse().map(c => `
                <div class="comment-item">
                    <div class="avatar">${c.user ? c.user.charAt(0).toUpperCase() : '?'}</div>
                    <div class="body">
                        <div class="user">${c.user || '匿名'} <span class="time">${c.time || '刚刚'}</span></div>
                        <div class="text">${c.text}</div>
                        <div class="actions">
                            <span onclick="likeComment(this)">👍 点赞</span>
                            <span onclick="replyComment(this)">💬 回复</span>
                        </div>
                    </div>
                </div>
            `).join('');
        }

        // 点赞功能
        window.likeComment = function(el) {
            const count = el.textContent.match(/\d+/);
            const num = count ? parseInt(count[0]) + 1 : 1;
            el.textContent = `👍 点赞 ${num}`;
            el.style.color = '#f0c040';
        };

        // 回复功能
        window.replyComment = function(el) {
            const name = el.closest('.comment-item').querySelector('.user').textContent.split(' ')[0];
            document.getElementById('commentText').value = `@${name} `;
            document.getElementById('commentText').focus();
        };

        // 提交评论
        document.getElementById('commentSubmit').addEventListener('click', function() {
            const user = document.getElementById('commentUser').value.trim() || '匿名';
            const text = document.getElementById('commentText').value.trim();
            if (!text) { alert('请写下你的评论内容'); return; }
            const now = new Date();
            const time = now.getFullYear() + '-' + String(now.getMonth() + 1).padStart(2, '0') + '-' + String(now.getDate())
                .padStart(2, '0') + ' ' + String(now.getHours()).padStart(2, '0') + ':' + String(now.getMinutes())
                .padStart(2, '0');
            comments.push({ user, time, text });
            saveComments();
            renderComments();
            document.getElementById('commentText').value = '';
            // 滚动到评论列表
            document.getElementById('commentList').scrollIntoView({ behavior: 'smooth' });
        });

        // 支持Ctrl+Enter提交
        document.getElementById('commentText').addEventListener('keydown', function(e) {
            if (e.key === 'Enter' && (e.ctrlKey || e.metaKey)) {
                document.getElementById('commentSubmit').click();
            }
        });

        // 初始化评论
        loadComments();

        // =====================================================================
        //  额外优化：图片懒加载 Intersection Observer
        // =====================================================================

        if ('IntersectionObserver' in window) {
            const imgObserver = new IntersectionObserver((entries) => {
                entries.forEach(entry => {
                    if (entry.isIntersecting) {
                        const img = entry.target;
                        const src = img.getAttribute('src');
                        if (src && src.startsWith('http')) {
                            img.loading = 'lazy';
                        }
                        imgObserver.unobserve(img);
                    }
                });
            }, { rootMargin: '100px' });
            document.querySelectorAll('.movie-card .poster img').forEach(img => {
                imgObserver.observe(img);
            });
        }

        // =====================================================================
        //  控制台提示
        // =====================================================================

        console.log('🎬 天天看高清影视在线官网 · 纯静态单页');
        console.log('📦 数据来源: 333mov.com (图片保留原链接)');
        console.log('💬 评论数据保存在 localStorage');

        console.log('✨ 天天看高清影视在线官网加载完成，祝您观影愉快！');
    </script>

</body>
</html>