@charset "utf-8";

/* ==========================================
   星光游戏库 - 核心设计系统与样式
   ========================================== */

/* 全局变量定义（支持深色与浅色模式） */
:root {
    /* 深色模式（默认 - 璀璨星空风格） */
    --bg-gradient: linear-gradient(135deg, #090d16 0%, #0f172a 60%, #1e1b4b 100%);
    --bg-color-fallback: #090d16;
    --sidebar-bg: rgba(15, 23, 42, 0.75);
    --card-bg: rgba(30, 41, 59, 0.45);
    --card-bg-hover: rgba(30, 41, 59, 0.7);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-hover: rgba(6, 182, 212, 0.4);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-orange: #ff7c00;
    --accent-cyan: #06b6d4;
    --accent-purple: #8b5cf6;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 15px rgba(6, 182, 212, 0.35);
    --head-bg: rgba(254, 243, 199, 0.08);
    --head-border: rgba(251, 191, 36, 0.2);
    --glass-blur: blur(12px);
    --btn-border: #8b5cf6;
    --btn-text: #a78bfa;
    --btn-bg: rgba(139, 92, 246, 0.1);
    --btn-hover-bg: #8b5cf6;
}

[data-theme="light"] {
    /* 亮色模式（温馨雅致风格） */
    --bg-gradient: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    --bg-color-fallback: #f1f5f9;
    --sidebar-bg: rgba(255, 255, 255, 0.85);
    --card-bg: rgba(255, 255, 255, 0.7);
    --card-bg-hover: rgba(255, 255, 255, 0.95);
    --border-color: rgba(15, 23, 42, 0.08);
    --border-color-hover: rgba(139, 92, 246, 0.4);
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 8px 30px rgba(15, 23, 42, 0.08);
    --shadow-glow: 0 0 15px rgba(139, 92, 246, 0.2);
    --head-bg: #fffbeb;
    --head-border: #fde68a;
    --btn-border: #6366f1;
    --btn-text: #6366f1;
    --btn-bg: rgba(99, 102, 241, 0.06);
    --btn-hover-bg: #6366f1;
}

/* 基础重置 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans CJK SC", "Source Han Sans CN", sans-serif;
    background: var(--bg-gradient) no-repeat fixed;
    background-color: var(--bg-color-fallback);
    color: var(--text-primary);
    min-height: 100vh;
    transition: background 0.5s ease, color 0.3s ease;
    overflow-x: hidden;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}
::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.3);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.6);
}

/* 页面容器（最大宽度约束在 750px，模仿原版的移动端与PC兼容结构） */
.container {
    max-width: 750px;
    margin: 0 auto;
    background: transparent;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.25);
    position: relative;
}

/* 头部通知与合作栏 */
.head {
    height: 44px;
    background-color: var(--head-bg);
    border-bottom: 1px solid var(--head-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    backdrop-filter: var(--glass-blur);
    transition: all 0.3s ease;
}

.head-info {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: var(--accent-orange);
    font-weight: 500;
}

.head-info svg {
    margin-right: 8px;
    animation: pulse 1.8s infinite alternate;
}

.theme-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 50%;
    transition: background 0.3s;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Banner 区域 */
.banner {
    width: 100%;
    aspect-ratio: 75 / 33; /* 对应 750:330 左右比例 */
    overflow: hidden;
    position: relative;
}

.banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
}

.banner:hover img {
    transform: scale(1.03);
}

.banner-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
    padding: 16px;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.banner-title {
    font-size: 20px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
    letter-spacing: 1px;
}

.banner-subtitle {
    font-size: 12px;
    opacity: 0.85;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
    margin-top: 2px;
}

/* 检索与IP状态面板 */
.search-ip-bar {
    padding: 14px 16px;
    background: rgba(15, 23, 42, 0.15);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    align-items: center;
}

.search-wrapper {
    flex: 1;
    position: relative;
}

.search-input {
    width: 100%;
    height: 38px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 0 16px 0 38px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

.search-wrapper svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
}

.ip-info {
    font-size: 11px;
    color: var(--text-secondary);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 0 12px;
    height: 38px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ip-info span {
    color: var(--accent-cyan);
    font-weight: 500;
}

/* 主内容双栏布局 */
.main {
    flex: 1;
    display: flex;
    min-height: 500px;
    background: transparent;
}

/* 左侧分类导航栏 */
.left-nav {
    width: 25%;
    background: var(--sidebar-bg);
    backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding-top: 8px;
    transition: all 0.3s ease;
}

.nav-item {
    display: block;
    width: 100%;
    height: 48px;
    line-height: 48px;
    text-align: center;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    cursor: pointer;
}

.nav-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.nav-item.active {
    color: var(--accent-orange);
    background: var(--card-bg);
    border-left: 3px solid var(--accent-orange);
    font-weight: 600;
}

/* 右侧游戏列表区 */
.right-content {
    width: 75%;
    padding: 16px;
    background: transparent;
    transition: all 0.3s ease;
}

.category-title-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.category-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    position: relative;
    padding-left: 10px;
}

.category-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 16px;
    background: var(--accent-orange);
    border-radius: 2px;
}

.ip-link {
    font-size: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ip-link:hover {
    color: var(--accent-orange);
}

/* 游戏卡片容器 */
.game-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* 游戏卡片动效与布局 */
.game-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 14px;
    transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.game-card:hover {
    transform: translateY(-2px);
    background: var(--card-bg-hover);
    border-color: var(--border-color-hover);
    box-shadow: var(--shadow-glow), var(--shadow-sm);
}

.game-card:hover::before {
    opacity: 1;
}

.game-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    z-index: 2;
}

.game-img {
    width: 58px;
    height: 58px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.game-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 65%;
}

.game-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-meta {
    font-size: 11px;
    color: var(--text-secondary);
}

.game-action {
    z-index: 2;
}

.view-btn {
    display: inline-block;
    height: 28px;
    line-height: 26px;
    padding: 0 14px;
    border: 1px solid var(--btn-border);
    color: var(--btn-text);
    background: var(--btn-bg);
    font-size: 12px;
    font-weight: 500;
    border-radius: 14px;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
}

.game-card:hover .view-btn {
    background: var(--btn-hover-bg);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.4);
}

/* 无数据提示 */
.no-data {
    text-align: center;
    padding: 40px 0;
    color: var(--text-secondary);
    font-size: 13px;
}

/* 动效关键帧 */
@keyframes pulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.15); opacity: 1; }
}

/* ==========================================
   移动端响应式布局 (适配宽 768px 以下设备)
   ========================================== */
@media screen and (max-width: 600px) {
    .search-ip-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .ip-info {
        max-width: 100%;
        justify-content: center;
    }

    .main {
        flex-direction: column;
    }

    /* 移动端左侧侧边栏转换为顶部水平滑动的分类标签栏 */
    .left-nav {
        width: 100%;
        height: auto;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding: 0;
        white-space: nowrap;
        background: var(--sidebar-bg);
        scrollbar-width: none; /* Firefox */
    }
    
    .left-nav::-webkit-scrollbar {
        display: none; /* Safari & Chrome */
    }

    .nav-item {
        display: inline-block;
        width: auto;
        padding: 0 18px;
        height: 44px;
        line-height: 44px;
        border-left: none;
        border-bottom: 3px solid transparent;
    }

    .nav-item.active {
        border-left: none;
        border-bottom: 3px solid var(--accent-orange);
        background: transparent;
    }

    .right-content {
        width: 100%;
    }
}
