:root {
    --primary: #177f2e; --accent: #3398cc; --dark: #1f262d; --darker: #151a20;
    --card-bg: #262e37; --border: #2e363f; --text: #e8ecef; --muted: #8a95a0;
}
body { background: #0f1419; color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
a { color: var(--text); transition: color .2s; }
a:hover { color: var(--accent); text-decoration: none; }

/* 导航栏 */
.navbar.bg-dark { background: linear-gradient(180deg, #1a2028, #151a20) !important; border-bottom: 1px solid var(--border); }
.navbar-brand img { height: 35px; }
.nav-link { color: #bdbdbd !important; font-size: 15px; padding: .5rem .9rem !important; display: inline-flex; align-items: center; gap: 6px; }
.nav-link:hover { color: #fff !important; }
.nav-item.home .nav-link { color: #fff !important; font-weight: 600; }
.nav-link i.nav-icon { width: 18px; text-align: center; font-size: 15px; }

/* 历史记录按钮 */
.history-btn { display: inline-flex; align-items: center; gap: 6px; background: linear-gradient(135deg, var(--accent), var(--primary)); color: #fff !important; padding: .45rem .9rem !important; border-radius: 20px; font-size: 14px; font-weight: 500; cursor: pointer; border: none; transition: all .25s; position: relative; margin-right: 10px; }
.history-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(51, 152, 204, .4); color: #fff !important; }
.history-btn .badge-dot { position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; background: #dc3545; border-radius: 50%; border: 2px solid var(--dark); display: none; }
.history-btn.has-record .badge-dot { display: block; animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.3); opacity: .7; } }

/* 子导航 */
#sub-header { background: var(--darker); border-bottom: 1px solid var(--border); padding: .6rem 0; }
.sub-container { display: flex; align-items: center; gap: 15px; }
#sub-nav .fa-bell { color: #ffc107; margin-right: 5px; }
#sub-nav a { color: var(--accent); font-size: 13px; font-weight: 500; }
.search-warp { flex: 1; max-width: 320px; }
.search-warp .form-control { background: var(--card-bg); border: 1px solid var(--border); color: var(--text); font-size: 13px; }
.search-warp .form-control:focus { background: var(--card-bg); color: var(--text); border-color: var(--accent); box-shadow: none; }
.search-warp .form-control::placeholder { color: var(--muted); }

/* 主内容 */
main { padding: 20px 0; }
.card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 6px; margin-bottom: 20px; transition: box-shadow .5s ease-in-out; }
.card:hover { box-shadow: 0px 0px 10px rgba(26, 26, 26, .1); }
.card-header { background: linear-gradient(90deg, rgba(51, 152, 204, .15), transparent); border-bottom: 1px solid var(--border); padding: .75rem 1rem; font-size: 16px; display: flex; align-items: center; justify-content: space-between; }
.card-header b { color: #fff; }
.card-header .fa-th-large { color: var(--accent); margin-right: 8px; }
.card-header a.float-right { color: var(--muted); font-size: 13px; }

/* 影片列表 Grid */
.threadlist { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.threadlist li { background: var(--darker); border-radius: 6px; overflow: hidden; transition: all .3s; cursor: pointer; }
.threadlist li:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }
.threadlist .pic { display: block; position: relative; padding-bottom: 140%; overflow: hidden; background: #1a1f26; }
.threadlist .pic img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.threadlist li:hover .pic img { transform: scale(1.08); }
.hdtag { position: absolute; bottom: 8px; left: 8px; background: rgba(23, 127, 46, .9); color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 3px; border: none; z-index: 2; }
.threadlist .icon { position: absolute; top: 8px; left: 8px; background: #dc3545; color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 3px; z-index: 2; }
.threadlist .icon.new { background: var(--accent); }
.threadlist h2 { font-size: 14px; margin: 0; padding: 10px 10px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.threadlist h2 a { color: var(--text); }
.date_hits { padding: 0 10px 10px; font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; align-items: center; }
.date_hits p { margin: 0; display: flex; justify-content: space-between; width: 100%; align-items: center; }
.date_hits .update-time { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
.date_hits .update-time .fa-clock-o { color: var(--accent); }

        /* ================= 影片列表海报角标优化 ================= */
        /* 左上角：状态标签 (热播/最新/更新) */
        .threadlist .icon { 
            position: absolute; 
            top: 10px; 
            left: 10px; 
            background: linear-gradient(135deg, #ff512f, #dd2476); /* 橙红渐变，突出热播 */
            color: #fff; 
            font-size: 11px; 
            font-weight: 600;
            padding: 4px 8px; 
            border-radius: 4px; 
            z-index: 3; 
            box-shadow: 0 2px 8px rgba(0,0,0,0.4);
            display: inline-flex;
            align-items: center;
            gap: 4px;
            letter-spacing: 0.5px;
        }
        /* 最新状态使用蓝绿渐变 */
        .threadlist .icon.new { 
            background: linear-gradient(135deg, #3398cc, #177f2e); 
        }
        .threadlist .icon i { font-size: 10px; }

        /* 右上角：豆瓣评分标签 */
        .threadlist .rating { 
            position: absolute; 
            top: 10px; 
            right: 10px; 
            background: rgba(0, 0, 0, 0.65); /* 深色半透明背景 */
            backdrop-filter: blur(4px); /* 毛玻璃效果 */
            color: #ffc107; /* 金色文字 */
            font-size: 12px; 
            font-weight: 700;
            padding: 4px 8px; 
            border-radius: 4px; 
            z-index: 3; 
            box-shadow: 0 2px 8px rgba(0,0,0,0.4);
            display: inline-flex;
            align-items: center;
            gap: 4px;
            border: 1px solid rgba(255, 193, 7, 0.3); /* 金色微边框 */
        }
        .threadlist .rating i { font-size: 11px; }
        /* Netflix 专属左上角图标 (红黑渐变) */
        .threadlist .icon.netflix { 
            background: linear-gradient(135deg, #E50914, #B00710); 
            font-weight: 700;
            letter-spacing: 1px;
        }

        /* 分页导航深色主题美化 */
        .pagination .page-item .page-link {
            background: var(--card-bg);
            border: 1px solid var(--border);
            color: var(--text);
            margin: 0 4px;
            border-radius: 4px !important;
            transition: all .2s;
        }
        .pagination .page-item .page-link:hover {
            background: var(--accent);
            border-color: var(--accent);
            color: #fff;
        }
        /* 豆瓣Top250专属左上角图标 (黑金渐变) */
        .threadlist .icon.top250 { 
            background: linear-gradient(135deg, #232526, #414345); 
            border: 1px solid #d4af37;
            color: #d4af37;
            font-weight: 700;
        }
        /* 专题列表专属左上角图标 (紫蓝渐变) */
        .threadlist .icon.topic { 
            background: linear-gradient(135deg, #8E2DE2, #4A00E0); 
        }
		
/* 轮播 */
.carousel { border-radius: 8px; overflow: hidden; margin-bottom: 20px; }
.carousel-item img { width: 100%; height: 420px; object-fit: cover; }
.carousel-control-prev, .carousel-control-next { width: 5%; }

/* 快捷链接 */
.txtguanggao { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.txtguanggao a { flex: 1; min-width: 120px; text-align: center; padding: 8px; border-radius: 4px; color: #fff; font-size: 13px; transition: all .3s; }
.txtguanggao a:nth-child(4n+1) { background: #dc3545; }
.txtguanggao a:nth-child(4n+2) { background: #007bff; }
.txtguanggao a:nth-child(4n+3) { background: #28a745; }
.txtguanggao a:nth-child(4n) { background: #ffc107; color: #333; }
.txtguanggao a:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 0, 0, .3); color: #fff; }

/* 历史记录面板 */
.history-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); backdrop-filter: blur(4px); z-index: 1040; opacity: 0; visibility: hidden; transition: all .3s; }
.history-overlay.show { opacity: 1; visibility: visible; }
.history-panel { position: fixed; top: 0; right: 0; width: 420px; max-width: 100%; height: 100vh; background: var(--darker); border-left: 1px solid var(--border); z-index: 1050; transform: translateX(100%); transition: transform .35s cubic-bezier(.4, 0, .2, 1); display: flex; flex-direction: column; box-shadow: -8px 0 30px rgba(0, 0, 0, .5); }
.history-panel.show { transform: translateX(0); }
.history-header { padding: 18px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; background: linear-gradient(180deg, #1f262d, #1a2028); }
.history-header h3 { margin: 0; font-size: 17px; color: #fff; display: flex; align-items: center; gap: 8px; }
.history-header h3 i { color: var(--accent); }
.history-close { background: transparent; border: none; color: var(--muted); font-size: 24px; cursor: pointer; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: all .2s; }
.history-close:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.history-toolbar { padding: 12px 20px; border-bottom: 1px solid var(--border); display: flex; gap: 8px; align-items: center; background: var(--dark); }
.history-tabs { display: flex; gap: 4px; flex: 1; }
.history-tab { padding: 6px 14px; border-radius: 16px; font-size: 13px; cursor: pointer; background: transparent; border: 1px solid var(--border); color: var(--muted); transition: all .2s; }
.history-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.history-clear { background: transparent; border: 1px solid var(--border); color: var(--muted); padding: 6px 12px; border-radius: 16px; font-size: 12px; cursor: pointer; transition: all .2s; }
.history-clear:hover { border-color: #dc3545; color: #dc3545; }
.history-body { flex: 1; overflow-y: auto; padding: 12px; }
.history-body::-webkit-scrollbar { width: 6px; }
.history-body::-webkit-scrollbar-track { background: transparent; }
.history-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.history-empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.history-empty i { font-size: 60px; color: var(--border); margin-bottom: 16px; display: block; }
.history-item { display: flex; gap: 12px; padding: 10px; border-radius: 6px; margin-bottom: 8px; background: var(--card-bg); border: 1px solid transparent; transition: all .2s; cursor: pointer; position: relative; }
.history-item:hover { border-color: var(--accent); background: #2a333d; }
.history-cover { width: 90px; height: 120px; border-radius: 4px; overflow: hidden; flex-shrink: 0; position: relative; background: #1a1f26; }
.history-cover img { width: 100%; height: 100%; object-fit: cover; }
.history-cover .play-icon { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .4); opacity: 0; transition: opacity .2s; }
.history-item:hover .play-icon { opacity: 1; }
.play-icon i { color: #fff; font-size: 28px; text-shadow: 0 2px 8px rgba(0, 0, 0, .5); }
.history-info { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; }
.history-title { font-size: 14px; color: #fff; font-weight: 500; margin: 0 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-meta { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.history-meta span { display: inline-flex; align-items: center; gap: 3px; }
.history-episode { display: inline-block; background: rgba(51, 152, 204, .2); color: var(--accent); font-size: 11px; padding: 2px 8px; border-radius: 10px; margin-bottom: 6px; }
.history-progress { height: 3px; background: var(--border); border-radius: 2px; overflow: hidden; margin-top: 4px; }
.history-progress-bar { height: 100%; background: linear-gradient(90deg, var(--accent), var(--primary)); border-radius: 2px; transition: width .3s; }
.history-time { font-size: 11px; color: var(--muted); margin-top: 4px; }
.history-delete { position: absolute; top: 8px; right: 8px; background: rgba(0, 0, 0, .5); border: none; color: var(--muted); width: 24px; height: 24px; border-radius: 50%; cursor: pointer; opacity: 0; transition: all .2s; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.history-item:hover .history-delete { opacity: 1; }
.history-delete:hover { background: #dc3545; color: #fff; }
.history-footer { padding: 12px 20px; border-top: 1px solid var(--border); background: var(--dark); font-size: 12px; color: var(--muted); text-align: center; }

/* Toast 提示 */
.toast-msg { position: fixed; top: 80px; left: 50%; transform: translateX(-50%) translateY(-20px); background: var(--dark); color: #fff; padding: 10px 20px; border-radius: 6px; border: 1px solid var(--accent); box-shadow: 0 4px 20px rgba(0, 0, 0, .4); z-index: 2000; opacity: 0; transition: all .3s; font-size: 14px; pointer-events: none; }
.toast-msg.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 响应式 */
@media (max-width: 991px) { .threadlist { grid-template-columns: repeat(3, 1fr); } .carousel-item img { height: 280px; } }
@media (max-width: 768px) { .threadlist { grid-template-columns: repeat(2, 1fr); gap: 10px; } .carousel-item img { height: 200px; } .history-panel { width: 100%; } .nav-link { padding: .4rem .6rem !important; font-size: 14px; } .history-btn { padding: .35rem .7rem !important; font-size: 13px; } }
@media (max-width: 510px) { .threadlist { grid-template-columns: repeat(2, 1fr); } }

/* Footer & 返回顶部 */
footer { background: var(--darker); border-top: 1px solid var(--border); padding: 24px 0; margin-top: 30px; color: var(--muted); font-size: 13px; text-align: center; }
footer a { color: var(--accent); }
.gotop { z-index: 10; position: fixed; top: 66%; left: 50%; margin-left: 610px; margin-top: 0px; }
.gotop ul { list-style-type: none; margin: 0; padding: 0; border: 1px solid var(--dark); border-radius: 4px; overflow: hidden; box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.gotop li a { display: block; width: 50px; height: 50px; border-bottom: 1px solid var(--dark); background-color: var(--card-bg); color: var(--text); line-height: 50px; text-align: center; transition: all .2s; text-decoration: none; }
.gotop li a i { font-size: 20px; }
.gotop li a em { display: none; }
.gotop li a:hover { background-color: var(--accent); color: #fff; }
.gotop li a:hover i { display: none; }
.gotop li a:hover em { display: block; font-style: normal; font-size: 12px; }
.gotop li:last-child a { border-bottom: 0; }
@media (max-width: 1200px) { .gotop { display: none; } }