
:root {
    --brand-blue: #2563eb;
    --brand-grad: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    --bg: #f8fafc;
    --text-main: #0f172a;
    --text-sub: #64748b;
    --white: #ffffff;
    --radius-lg: 24px;
    --radius-sm: 12px;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.05), 0 10px 15px -3px rgba(0,0,0,0.05);
}

* { margin: 0; padding: 0; box-sizing: border-box; scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text-main); font-family: 'Inter', -apple-system, system-ui, sans-serif; }

.container { max-width: 1240px; margin: 0 auto; padding: 0 20px; }

/* --- 极简导航 (微调以加入搜索按钮) --- */
nav.top-nav {
    background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(12px);
    height: 72px; display: flex; align-items: center;
    position: sticky; top: 0; z-index: 1000; border-bottom: 1px solid rgba(0,0,0,0.05);
}
.nav-inner { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.logo { font-size: 22px; font-weight: 800; color: var(--text-main); text-decoration: none; letter-spacing: -1px; }
.logo span { color: var(--brand-blue); }

.nav-right { display: flex; align-items: center; gap: 15px; }
.search-trigger { cursor: pointer; font-size: 18px; color: var(--text-main); padding: 8px; border-radius: 50%; transition: 0.2s; background: #f1f5f9; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; }
.search-trigger:hover { background: #e2e8f0; }

/* --- 搜索遮罩层 --- */
#searchOverlay {
    position: fixed; inset: 0; background: rgba(255,255,255,0.98); z-index: 2000;
    display: none; flex-direction: column; padding: 20px; animation: slideDown 0.3s ease-out;
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
.search-box { max-width: 800px; margin: 60px auto 0; width: 100%; display: flex; gap: 15px; }
.search-input { flex: 1; padding: 15px 20px; border-radius: 15px; border: 2px solid var(--brand-blue); font-size: 18px; outline: none; box-shadow: var(--shadow); }
.close-search { background: var(--text-main); color: #fff; padding: 15px 25px; border-radius: 15px; font-weight: 700; cursor: pointer; }

/* --- 原有内容样式保持不变 --- */
.portal-intro { padding: 80px 0 40px; text-align: center; }
.portal-intro h1 { font-size: 48px; font-weight: 900; margin-bottom: 20px; letter-spacing: -1.5px; }
.portal-intro h1 span { background: var(--brand-grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.portal-intro p { font-size: 1.1rem; color: var(--text-sub); margin: 0 auto; line-height: 1.6; }

.category-bar { display: flex; gap: 10px; overflow-x: auto; padding: 10px 0 40px; scrollbar-width: none; }
.category-bar::-webkit-scrollbar { display: none; }
.cat-pill {
    background: var(--white); padding: 12px 24px; border-radius: 100px;
    text-decoration: none; color: var(--text-main); font-weight: 600; font-size: 14px;
    box-shadow: var(--shadow); transition: 0.3s; border: 1px solid transparent;
    display: flex; align-items: center; gap: 8px;
}
.cat-pill:hover, .cat-pill.active { background: var(--text-main); color: var(--white); transform: translateY(-2px); }

.collection-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 24px; margin-bottom: 80px; }

.game-site-card {
    background: var(--white); border-radius: var(--radius-lg); overflow: hidden;
    text-decoration: none; color: inherit; box-shadow: var(--shadow);
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(0,0,0,0.02); display: flex; flex-direction: column;
}
.game-site-card:hover { transform: translateY(-10px) scale(1.02); box-shadow: 0 25px 50px -12px rgba(0,0,0,0.08); }

.preview-img { width: 100%; aspect-ratio: 16/10; overflow: hidden; background: #eee; }
.preview-img img { width: 100%; height: 100%; object-fit: cover; }

.card-body { padding: 30px; display: flex; flex-direction: column; flex: 1; }
.card-body .site-type { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--brand-blue); margin-bottom: 12px; }
.card-body h3 { font-size: 22px; font-weight: 700; margin-bottom: 12px; }
.card-body p { font-size: 15px; color: var(--text-sub); line-height: 1.5; margin-bottom: 20px; flex: 1; }

.card-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 20px; border-top: 1px solid #f1f5f9; }
.stats { display: flex; gap: 15px; font-size: 13px; color: var(--text-sub); font-weight: 600; }
.visit-link { color: var(--brand-blue); font-weight: 700; font-size: 14px; }

/* --- 回到顶部按钮 --- */
#backToTop {
    position: fixed; bottom: 30px; right: 20px;
    width: 50px; height: 50px; background: var(--text-main);
    color: #fff; border-radius: 50%; display: flex;
    align-items: center; justify-content: center;
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
    cursor: pointer; opacity: 0; visibility: hidden;
    transition: 0.3s; z-index: 1500;
}
#backToTop.show { opacity: 1; visibility: visible; }

footer { background: #fff; padding: 100px 0 40px; border-top: 1px solid #f1f5f9; }
.footer-content { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 80px; }

@media (max-width: 768px) {
    .portal-intro h1 { font-size: 32px; }
    .collection-grid { grid-template-columns: 1fr; }
    .footer-content { grid-template-columns: 1fr; gap: 40px; }
}