/* ===== Li-Game 主样式 ===== */
:root {
    --nav-h: 56px;
    --sidebar-w: 240px;
    --bg: #f3f4f6;
    --card-bg: #fff;
    --text: #111827;
    --text-sub: #6b7280;
    --border: #e5e7eb;
    --blue: #3b82f6;
    --radius: 12px;
}
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html, body { height:100%; overflow:hidden; }
body { font-family:'Noto Sans SC', system-ui, -apple-system, sans-serif; background:var(--bg); color:var(--text); }

/* ===== 顶部导航 ===== */
.top-nav { position:fixed; top:0; left:0; right:0; height:var(--nav-h); background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.08); z-index:100; }
.nav-inner { max-width:1600px; margin:0 auto; padding:0 16px; height:100%; display:flex; align-items:center; justify-content:space-between; }
.nav-brand { display:flex; align-items:center; gap:8px; text-decoration:none; color:var(--text); }
.brand-icon { font-size:24px; color:var(--blue); }
.brand-text { font-size:18px; font-weight:800; }
.mobile-toggle { display:none; background:none; border:none; font-size:20px; color:var(--text); cursor:pointer; padding:8px; }
.nav-links { display:flex; align-items:center; gap:16px; }
.nav-link { display:flex; align-items:center; gap:6px; color:var(--text-sub); text-decoration:none; font-size:14px; background:none; border:none; cursor:pointer; padding:6px 12px; border-radius:8px; transition:all .2s; }
.nav-link:hover { color:var(--text); background:#f3f4f6; }

/* ===== 主体布局 ===== */
.main-wrap { display:flex; margin-top:var(--nav-h); height:calc(100vh - var(--nav-h)); overflow:hidden; max-width:1600px; margin-left:auto; margin-right:auto; padding:12px 16px 12px 16px; gap:12px; }

/* ===== 侧边栏 ===== */
.sidebar { width:var(--sidebar-w); flex-shrink:0; background:#fff; border-radius:var(--radius); box-shadow:0 1px 3px rgba(0,0,0,.06); overflow-y:auto; }
.sidebar-inner { padding:16px; }
.sidebar-section { margin-bottom:20px; }
.sidebar-title { font-size:11px; font-weight:600; color:#9ca3af; text-transform:uppercase; letter-spacing:1.5px; margin-bottom:10px; }
.chip-group, .tag-group { display:flex; flex-wrap:wrap; gap:6px; }
.chip { padding:5px 14px; border-radius:20px; border:1px solid var(--border); background:#fff; color:var(--text-sub); font-size:13px; font-weight:500; cursor:pointer; transition:all .2s; white-space:nowrap; }
.chip:hover { border-color:#93c5fd; color:var(--blue); background:#eff6ff; }
.chip.chip-active { background:var(--blue); color:#fff; border-color:var(--blue); }
.tag { padding:4px 12px; border-radius:16px; border:1px solid var(--border); background:#f9fafb; color:var(--text-sub); font-size:12px; cursor:pointer; transition:all .2s; white-space:nowrap; }
.tag:hover { border-color:#93c5fd; color:var(--blue); }
.tag.tag-active { background:#eff6ff; color:var(--blue); border-color:#bfdbfe; }
.sidebar-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,.5); z-index:89; }

/* ===== 内容区 ===== */
.content { flex:1; min-width:0; display:flex; flex-direction:column; background:#fff; border-radius:var(--radius); box-shadow:0 1px 3px rgba(0,0,0,.06); overflow:hidden; }
.content-scroll { flex:1; overflow-y:auto; padding:16px; background:#f9fafb; }
.discover-container, .list-container { max-width:1400px; margin:0 auto; }

/* ===== 搜索栏 ===== */
.search-bar { padding:12px 16px; border-bottom:1px solid var(--border); background:#fff; flex-shrink:0; }
.search-wrap { position:relative; max-width:500px; margin:0 auto; }
.search-icon { position:absolute; left:12px; top:50%; transform:translateY(-50%); color:#9ca3af; font-size:14px; }
.search-input { width:100%; padding:8px 16px 8px 36px; border:1px solid var(--border); border-radius:10px; font-size:14px; background:#f9fafb; outline:none; transition:all .2s; }
.search-input:focus { border-color:var(--blue); box-shadow:0 0 0 3px rgba(59,130,246,.15); background:#fff; }

/* ===== 章节标题 ===== */
.section-title { font-size:24px; font-weight:800; color:#1e293b; display:flex; align-items:center; gap:10px; margin-bottom:20px; letter-spacing:-.5px; }
.section-title i { font-size:20px; color:#64748b; }
.section-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:20px; }
.section-header .section-title { margin-bottom:0; }
.btn-refresh { display:flex; align-items:center; gap:6px; padding:8px 20px; background:#64748b; color:#fff; border:none; border-radius:20px; font-size:13px; font-weight:600; cursor:pointer; transition:all .25s; box-shadow:0 4px 12px rgba(100,116,139,.3); }
.btn-refresh:hover { background:#475569; transform:translateY(-1px); box-shadow:0 6px 16px rgba(100,116,139,.4); }
.btn-refresh.spinning i { animation:spin .6s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }

/* ===== 合集卡片 ===== */
.collections-grid { display:grid; grid-template-columns:repeat(3, 1fr); gap:16px; margin-bottom:24px; }
.collection-card { height:160px; border-radius:20px; overflow:hidden; cursor:pointer; transition:all .35s; box-shadow:0 4px 16px rgba(0,0,0,.12); position:relative; }
.collection-card:hover { transform:translateY(-4px) scale(1.01); box-shadow:0 12px 32px rgba(0,0,0,.18); }
.collection-card.active { ring:4px solid var(--blue); }
.collection-inner { position:relative; width:100%; height:100%; padding:24px; display:flex; align-items:center; justify-content:space-between; color:#fff; background-size:cover; background-position:center; }
.collection-inner::before { content:''; position:absolute; inset:0; background:linear-gradient(135deg,rgba(0,0,0,.25),rgba(0,0,0,.45)); }
.collection-info { position:relative; z-index:1; flex:1; min-width:0; }
.collection-info h3 { font-size:22px; font-weight:800; margin-bottom:6px; text-shadow:0 2px 8px rgba(0,0,0,.3); }
.collection-info p { font-size:13px; opacity:.9; margin-bottom:10px; }
.collection-meta { display:flex; gap:12px; font-size:13px; font-weight:600; }
.collection-meta span { background:rgba(255,255,255,.2); padding:4px 12px; border-radius:16px; display:flex; align-items:center; gap:5px; }
.collection-arrow { position:relative; z-index:1; font-size:20px; transition:transform .3s; }
.collection-card.active .collection-arrow { transform:rotate(180deg); }

/* 合集展开区 */
.collection-expand { background:linear-gradient(135deg,#eff6ff,#eef2ff); border-radius:16px; border:1px solid #bfdbfe; overflow:hidden; margin-bottom:24px; animation:expandIn .3s ease; }
@keyframes expandIn { from { opacity:0; max-height:0; } to { opacity:1; max-height:800px; } }
.expand-inner { padding:20px; }
.expand-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:16px; }
.expand-title-wrap { display:flex; align-items:center; gap:10px; }
.expand-title-wrap .bar { width:3px; height:28px; background:linear-gradient(to bottom,var(--blue),#6366f1); border-radius:2px; }
.expand-title-wrap h3 { font-size:18px; font-weight:700; color:#1e293b; }
.expand-title-wrap .sub { font-size:13px; color:#64748b; }
.expand-close { width:36px; height:36px; border-radius:50%; background:#fff; border:none; color:#64748b; font-size:16px; cursor:pointer; display:flex; align-items:center; justify-content:center; transition:all .2s; box-shadow:0 1px 4px rgba(0,0,0,.08); }
.expand-close:hover { background:#f1f5f9; color:#1e293b; transform:scale(1.1); }

/* ===== 游戏卡片网格 ===== */
.game-grid { display:grid; grid-template-columns:repeat(6, 1fr); gap:16px; }
.game-card { background:#fff; border-radius:var(--radius); overflow:hidden; cursor:pointer; transition:all .3s; border:1px solid var(--border); }
.game-card:hover { box-shadow:0 8px 24px rgba(0,0,0,.1); border-color:#bfdbfe; transform:translateY(-3px); }
.card-cover { position:relative; aspect-ratio:3/2; width:100%; overflow:hidden; background:linear-gradient(135deg,#f1f5f9,#e2e8f0); }
.card-cover img { width:100%; height:100%; object-fit:cover; transition:all .3s; }
.game-card:hover .card-cover img { transform:scale(1.08); filter:brightness(.75); }
.card-overlay { position:absolute; inset:0; background:rgba(0,0,0,0); display:flex; align-items:center; justify-content:center; transition:background .3s; }
.game-card:hover .card-overlay { background:rgba(0,0,0,.45); }
.play-btn { transform:scale(0); transition:transform .3s; text-align:center; }
.game-card:hover .play-btn { transform:scale(1); }
.play-btn i { font-size:42px; color:#fff; filter:drop-shadow(0 2px 8px rgba(0,0,0,.3)); display:block; margin-bottom:4px; }
.play-btn span { color:#fff; font-size:12px; font-weight:700; letter-spacing:.5px; text-shadow:0 1px 4px rgba(0,0,0,.4); }
.card-type-badge { position:absolute; top:6px; right:6px; padding:2px 8px; background:rgba(0,0,0,.65); backdrop-filter:blur(4px); color:#fff; font-size:10px; font-weight:700; border-radius:6px; text-transform:uppercase; }
.card-recommend-badge { position:absolute; top:6px; left:6px; padding:3px 10px; background:linear-gradient(to right,#f59e0b,#d97706); color:#fff; font-size:10px; font-weight:700; border-radius:6px; display:flex; align-items:center; gap:3px; }
.card-body { padding:10px; }
.card-name { font-size:13px; font-weight:600; color:#111827; line-height:1.3; display:-webkit-box; -webkit-line-clamp:1; -webkit-box-orient:vertical; overflow:hidden; margin-bottom:6px; transition:color .2s; }
.game-card:hover .card-name { color:var(--blue); }
.card-tags { display:flex; flex-wrap:wrap; gap:4px; }
.card-tag { font-size:11px; padding:1px 8px; background:#eff6ff; color:#3b82f6; border-radius:8px; border:1px solid #dbeafe; font-weight:500; }
.card-tag-extra { font-size:11px; padding:1px 8px; background:#f3f4f6; color:#6b7280; border-radius:8px; }

/* ===== 最近玩过（横向滚动） ===== */
.recent-scroll { display:flex; gap:16px; overflow-x:auto; padding-bottom:12px; scroll-behavior:smooth; }
.recent-scroll::-webkit-scrollbar { height:6px; }
.recent-scroll::-webkit-scrollbar-thumb { background:#cbd5e1; border-radius:3px; }
.recent-scroll .game-card { flex-shrink:0; width:190px; }

/* ===== 加载状态 ===== */
.loading-spinner { text-align:center; padding:60px 0; color:#64748b; }
.loading-spinner i { font-size:36px; color:var(--blue); margin-bottom:12px; display:block; }
.load-more { text-align:center; padding:16px; }
.loading-dots { display:flex; justify-content:center; gap:6px; }
.loading-dots span { width:8px; height:8px; background:var(--blue); border-radius:50%; animation:bounce .6s ease-in-out infinite; }
.loading-dots span:nth-child(2) { animation-delay:.15s; }
.loading-dots span:nth-child(3) { animation-delay:.3s; }
@keyframes bounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }
.load-end { text-align:center; padding:16px; color:#9ca3af; font-size:13px; }

/* ===== 空状态 ===== */
.empty-state { text-align:center; padding:60px 20px; color:#9ca3af; }
.empty-state i { font-size:48px; margin-bottom:16px; opacity:.5; display:block; }

/* ===== 响应式 ===== */
@media (max-width:1280px) {
    .game-grid { grid-template-columns:repeat(5,1fr); }
}
@media (max-width:1024px) {
    .game-grid { grid-template-columns:repeat(4,1fr); }
    .collections-grid { grid-template-columns:repeat(2,1fr); }
}
@media (max-width:768px) {
    .mobile-toggle { display:block; }
    .nav-links { display:none; }
    .nav-links.show { display:flex; position:absolute; top:var(--nav-h); left:0; right:0; background:#fff; padding:12px 16px; flex-direction:column; box-shadow:0 4px 12px rgba(0,0,0,.1); }
    .main-wrap { padding:8px; gap:0; }
    .sidebar { position:fixed; left:0; top:var(--nav-h); bottom:0; z-index:90; border-radius:0; transform:translateX(-100%); transition:transform .3s; width:260px; }
    .sidebar.open { transform:translateX(0); }
    .sidebar-overlay.show { display:block; }
    .game-grid { grid-template-columns:repeat(3,1fr); gap:10px; }
    .collections-grid { grid-template-columns:1fr; }
    .collection-card { height:130px; }
    .section-title { font-size:20px; }
    .recent-scroll .game-card { width:160px; }
}
@media (max-width:480px) {
    .game-grid { grid-template-columns:repeat(2,1fr); gap:8px; }
    .card-body { padding:8px; }
    .card-name { font-size:12px; }
}

/* ===== 滚动条美化 ===== */
.content-scroll::-webkit-scrollbar { width:6px; }
.content-scroll::-webkit-scrollbar-thumb { background:#d1d5db; border-radius:3px; }
.content-scroll::-webkit-scrollbar-thumb:hover { background:#9ca3af; }
.sidebar::-webkit-scrollbar { width:4px; }
.sidebar::-webkit-scrollbar-thumb { background:#e5e7eb; border-radius:2px; }
