* { margin: 0; padding: 0; box-sizing: border-box; }

        :root {
            --bg-primary: #0a0a0a;
            --bg-secondary: #151515;
            --bg-card: #1a1a1a;
            --gold: #d4af37;
            --gold-light: #f4d47e;
            --gold-dark: #b8941f;
            --text-primary: #ffffff;
            --text-secondary: #b0b0b0;
            --text-muted: #666666;
            --accent-red: #e74c3c;
            --border-color: #2a2a2a;
        }

        body {
            font-family: 'Noto Sans SC', sans-serif;
            background: var(--bg-primary);
            color: var(--text-primary);
        }

        /* ===== 导航栏 (保持不变) ===== */
        .navbar {
            position: fixed; top: 0; width: 100%; background: rgba(10, 10, 10, 0.95);
            backdrop-filter: blur(10px); border-bottom: 1px solid var(--border-color);
            z-index: 1000; padding: 1.2rem 0;
        }
        .nav-container { max-width: 1400px; margin: 0 auto; padding: 0 2rem; display: flex; justify-content: space-between; align-items: center; }
        .logo { font-family: 'Cinzel', serif; font-size: 1.8rem; font-weight: 700; background: linear-gradient(135deg, var(--gold), var(--gold-light)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; letter-spacing: 2px; cursor: pointer; }
        .nav-links { display: flex; gap: 2.5rem; align-items: center; }
        .nav-links a { color: var(--text-secondary); text-decoration: none; transition: color 0.3s; }
        .nav-links a:hover { color: var(--gold); }
        .btn-primary, .btn-secondary { padding: 0.5rem 1.2rem; border-radius: 6px; cursor: pointer; font-weight: 600; transition: all 0.3s; border: none; }
        .btn-primary { background: linear-gradient(135deg, var(--gold-dark), var(--gold)); color: var(--bg-primary); }
        .btn-secondary { background: transparent; color: var(--gold); border: 1px solid var(--gold); }

        /* ===== 主容器 (不再使用 Grid 分割左右，改为全宽) ===== */
        .main-container {
            margin-top: 240px; /* 🌟 关键修改：给上方固定住的筛选栏让出足够的空间，防止第一排剧本被吃掉 */
            max-width: 1400px;
            margin-left: auto;
            margin-right: auto;
            padding: 3rem 2rem;
            display: flex;
            flex-direction: column;
            gap: 2rem;
        }

        /* ===== 🌟 核心升级：顶部聚合横向筛选栏 ===== */
        /* 🌟 核心修复：顶部聚合横向筛选栏 */
        /* ===== 🌟 核心升级：顶部聚合横向筛选栏 (绝对固定通栏版) ===== */
        .top-filter-bar {
            position: fixed; /* 🌟 关键：彻底钉死在屏幕上方，绝对不跟着滚动 */
            top: 75px; /* 完美卡在顶部导航栏正下方 */
            left: 0;
            width: 100%; /* 强制横向拉满整个屏幕 */
            background: rgba(15, 15, 15, 0.98); /* 加深背景，彻底防止底部卡片穿模 */
            border-bottom: 1px solid var(--border-color);
            border-radius: 0; /* 去掉圆角，变成真正的一通到底 */
            padding: 1.5rem 5%; /* 两边留一点舒适的边距 */
            display: flex;
            flex-direction: column;
            gap: 1.5rem;
            box-shadow: 0 10px 30px rgba(0,0,0,0.8);
            z-index: 900;
        }

        /* 上半部分：搜索 + 快捷分类组 */
        .top-filter-row-1 {
            display: flex;
            gap: 1rem;
            align-items: center;
            flex-wrap: wrap;
        }

        .search-wrapper {
            flex: 2; /* 🌟 加大比例，让搜索框拉得更长 */
            min-width: 400px;
            display: flex;
        }

        .search-input {
            flex: 1;
            background: var(--bg-secondary);
            border: 1px solid var(--border-color);
            border-right: none;
            border-radius: 8px 0 0 8px;
            padding: 1rem 1.2rem;
            color: var(--text-primary);
            font-size: 1rem;
        }
        .search-input:focus { outline: none; border-color: var(--gold); }

        .search-btn {
            background: linear-gradient(135deg, var(--gold-dark), var(--gold));
            color: var(--bg-primary);
            border: none;
            border-radius: 0 8px 8px 0;
            padding: 0 1.5rem;
            font-weight: bold;
            cursor: pointer;
            transition: opacity 0.3s;
        }
        .search-btn:hover { opacity: 0.9; }

        /* 快捷分类胶囊 (横向铺开) */
        .category-pills {
            display: flex;
            flex: 3; /* 让胶囊也占满剩余空间 */
            gap: 0.5rem;
            overflow-x: auto;
            padding-bottom: 5px; 
        }
        .category-pills::-webkit-scrollbar { height: 4px; }
        .category-pills::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }

        .category-pill {
            background: var(--bg-secondary);
            border: 1px solid var(--border-color);
            color: var(--text-secondary);
            padding: 0.6rem 1.2rem;
            border-radius: 20px;
            font-size: 0.9rem;
            cursor: pointer;
            white-space: nowrap;
            transition: all 0.3s;
        }
        .category-pill:hover { border-color: var(--gold); color: var(--gold); }
        .category-pill.active { background: rgba(212, 175, 55, 0.15); border-color: var(--gold); color: var(--gold); font-weight: bold; }

        /* 下半部分：高级下拉筛选器组 */
        .top-filter-row-2 {
            display: flex;
            gap: 1rem;
            align-items: center;
            flex-wrap: wrap;
            border-top: 1px solid var(--border-color);
            padding-top: 1.5rem;
        }

        .filter-select {
            background: var(--bg-secondary);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            padding: 0.8rem 1rem;
            color: var(--text-primary);
            cursor: pointer;
            min-width: 150px;
            font-size: 0.9rem;
            outline: none;
        }
        .filter-select:focus { border-color: var(--gold); }

        .price-range-group {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            background: var(--bg-secondary);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            padding: 0.3rem 0.5rem;
        }
        .price-mini-input {
            background: transparent;
            border: none;
            color: var(--text-primary);
            width: 70px;
            text-align: center;
            font-size: 0.9rem;
            outline: none;
        }
        .price-mini-input::placeholder { color: var(--text-muted); }
        
        /* 🌟 恢复并美化按钮组 */
        .filter-actions-group {
            margin-left: auto; /* 自动把按钮推到最右侧紧贴边缘 */
            display: flex;
            gap: 1rem;
        }
        
        /* 🌟 核心修复：找回失踪的按钮 */
        .reset-btn {
            margin-left: auto; /* 关键：自动占用左侧所有剩余空间，把按钮推到最右侧边缘！ */
            background: transparent;
            color: var(--text-muted);
            border: 1px solid var(--border-color);
            padding: 0.8rem 1.2rem;
            border-radius: 8px;
            cursor: pointer;
            font-size: 0.9rem;
            transition: all 0.3s;
        }
        .reset-btn:hover { color: var(--text-primary); border-color: var(--text-primary); }

        .apply-btn {
            background: linear-gradient(135deg, var(--gold-dark), var(--gold));
            color: var(--bg-primary);
            border: none;
            padding: 0.8rem 1.5rem;
            border-radius: 8px;
            cursor: pointer;
            font-weight: bold;
            font-size: 0.9rem;
            transition: all 0.3s;
        }
        .apply-btn:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3); }

        /* ===== 内容区与卡片 ===== */
        .results-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; margin-top: 1rem; }
        .results-count { color: var(--text-secondary); }
        .results-count strong { color: var(--gold); }

        /* 网格现在更宽了，可以放更多卡片 */
        .scripts-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 2rem;
        }

        .script-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 12px; overflow: hidden; transition: all 0.3s; cursor: pointer; }
        .script-card:hover { transform: translateY(-6px); border-color: var(--gold); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6); }
        
        .script-cover { height: 180px; background: linear-gradient(135deg, #1a1a1a, #2a2a2a); display: flex; align-items: center; justify-content: center; font-size: 4rem; border-bottom: 2px solid var(--gold); position: relative;}
        
        .script-info { padding: 1.5rem; }
        .script-category { display: inline-block; background: rgba(212, 175, 55, 0.2); color: var(--gold); padding: 0.3rem 0.8rem; border-radius: 4px; font-size: 0.8rem; margin-bottom: 0.8rem; }
        .script-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 0.5rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .script-author { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 1rem; }
        .script-meta { display: flex; justify-content: space-between; background: rgba(0,0,0,0.3); padding: 8px 12px; border-radius: 6px; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1.2rem; }
        .script-footer { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border-color); padding-top: 1rem; }
        .script-price { font-size: 1.5rem; font-weight: 700; color: var(--gold); }

        /* 分页 */
        .pagination { display: flex; justify-content: center; gap: 0.5rem; margin-top: 4rem; }
        .page-btn { min-width: 40px; height: 40px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--text-primary); transition: all 0.3s; }
        .page-btn:hover, .page-btn.active { border-color: var(--gold); color: var(--gold); }
        .page-btn:disabled { opacity: 0.3; cursor: not-allowed; }