/* ===========================
   基础变量（颜色/阴影/尺寸）- 移动优先
   =========================== */
:root {
    --bg: linear-gradient(135deg, #191a2b 0%, #25274d 100%);
    --card-bg: rgba(36,34,67,0.93);
    --card-border: rgba(189,196,255,0.15);
    --text: #f5f6fa;
    --muted: #94a3b8;
    --accent: #8b5cf6;
    --accent2: #00f5ff;
    --radius: 20px;
    --shadow: 0 12px 36px rgba(50,30,130,0.16),0 1.5px 6px #0002;
    /* 手机端专用变量 */
    --mobile-padding: 12px;
    --mobile-gap: 14px;
    --mobile-font-base: 15px;
    --mobile-radius: 16px;
}

/* ===========================
   基础样式
   =========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    font-family: 'Segoe UI', 'Roboto', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    color: var(--text);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

/* ===========================
   背景动线
   =========================== */
.bg-lines {
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: 0.32;
    pointer-events: none;
}

/* ===========================
   容器布局
   =========================== */
.wrap {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: var(--mobile-padding);
    padding-top: 24px;
    padding-bottom: 40px;
    box-sizing: border-box;
}

/* ===========================
   返回按钮
   =========================== */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    margin-bottom: 20px;
    background: rgba(139,92,246,0.15);
    border: 1px solid var(--card-border);
    border-radius: var(--mobile-radius);
    color: var(--text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    backdrop-filter: blur(12px);
}

.back-btn:hover {
    background: rgba(139,92,246,0.25);
    transform: translateX(-2px);
}

.back-btn:active {
    transform: translateX(0) scale(0.98);
}

/* ===========================
   LOGO区域
   =========================== */
.logo {
    width: 100%;
    padding: 16px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

.logo a {
    display: inline-block;
    transition: transform 0.3s;
}

.logo img {
    height: 60px;
    width: auto;
    display: block;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(139,92,246,0.3);
    transition: transform 0.3s, box-shadow 0.3s;
}

.logo a:hover img {
    transform: scale(1.05);
    box-shadow: 0 6px 24px rgba(139,92,246,0.5);
}

/* ===========================
   顶部区域
   =========================== */
.top {
    text-align: center;
    margin-bottom: 24px;
    padding: 20px;
}

.top h1 {
    font-size: clamp(24px, 6vw, 32px);
    margin-bottom: 8px;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.sub_title {
    margin-top: 6px;
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 16px;
}

.user_info {
    margin-top: 16px;
}

.user-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(139,92,246,0.2), rgba(0,245,255,0.2));
    border: 1px solid var(--card-border);
    border-radius: 12px;
    color: var(--text);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s;
}

.user-link:hover {
    background: linear-gradient(135deg, rgba(139,92,246,0.3), rgba(0,245,255,0.3));
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(139,92,246,0.3);
}

.user-icon {
    font-size: 18px;
}

.user-arrow {
    font-size: 16px;
    opacity: 0.7;
    transition: transform 0.3s;
}

.user-link:hover .user-arrow {
    transform: translateX(4px);
}

/* ===========================
   卡片组件
   =========================== */
.card {
    background: var(--card-bg);
    border: 1.5px solid var(--card-border);
    border-radius: var(--mobile-radius);
    padding: 18px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
    transition: all 0.3s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 48px rgba(139,92,246,0.3);
}

/* ===========================
   主区域布局
   =========================== */
.main_box {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* ===========================
   小游戏列表区域
   =========================== */
.game_box {
    padding: 20px;
}

.section_title {
    font-size: clamp(20px, 5vw, 24px);
    margin-bottom: 18px;
    color: var(--text);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 游戏列表 */
.game_list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 单个游戏入口 */
.game_item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-radius: 14px;
    background: rgba(139,92,246,0.08);
    border: 1px solid rgba(139,92,246,0.2);
    text-decoration: none;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.game_item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s;
}

.game_item:hover::before {
    left: 100%;
}

.game_item:hover {
    background: rgba(139,92,246,0.15);
    border-color: rgba(139,92,246,0.4);
    transform: translateX(4px);
    box-shadow: 0 8px 24px rgba(139,92,246,0.2);
}

.game_item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(148,163,184,0.1);
    border-color: rgba(148,163,184,0.2);
}

.game_item.disabled:hover {
    transform: none;
    box-shadow: none;
}

.game_icon {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(139,92,246,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.game_icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.game_placeholder {
    font-size: 32px;
    opacity: 0.6;
}

.game_info {
    flex: 1;
    min-width: 0;
}

.game_info h4 {
    font-size: 17px;
    color: var(--text);
    margin-bottom: 4px;
    font-weight: 600;
}

.game_desc {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.4;
    margin: 0;
}

.game_arrow {
    font-size: 20px;
    color: var(--accent2);
    opacity: 0.7;
    transition: all 0.3s;
    flex-shrink: 0;
}

.game_item:hover .game_arrow {
    transform: translateX(4px);
    opacity: 1;
}

/* ===========================
   排行榜入口
   =========================== */
.order_box {
    text-align: center;
    margin-top: 8px;
}

.order_btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    border-radius: var(--mobile-radius);
    text-decoration: none;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(139,92,246,0.4);
    border: none;
    min-height: 52px;
}

.order_btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(139,92,246,0.5);
    background: linear-gradient(135deg, #9d6af7, #1affff);
}

.order_btn:active {
    transform: translateY(0) scale(0.98);
}

.btn-icon {
    font-size: 20px;
}

.btn-text {
    flex: 1;
}

.btn-arrow {
    font-size: 18px;
    opacity: 0.8;
    transition: transform 0.3s;
}

.order_btn:hover .btn-arrow {
    transform: translateX(4px);
}

/* ===========================
   页脚
   =========================== */
.page-footer {
    display: block;
    text-align: center;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--card-border);
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.footer-link {
    color: var(--accent2);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    padding: 4px 8px;
    border-radius: 6px;
}

.footer-link:hover {
    color: var(--accent);
    background: rgba(139,92,246,0.1);
    transform: translateY(-1px);
}

.footer-divider {
    color: var(--muted);
    opacity: 0.5;
}

.footer-copyright {
    color: var(--muted);
    font-size: 12px;
    margin-top: 8px;
    line-height: 1.6;
}

/* ===========================
   移动端优化
   =========================== */
@media (max-width: 480px) {
    .wrap {
        padding: 10px;
        padding-top: 20px;
        padding-bottom: 32px;
    }

    .logo img {
        height: 50px;
    }

    .card {
        padding: 14px;
        border-radius: 14px;
    }

    .top {
        padding: 16px;
    }

    .top h1 {
        font-size: 22px;
    }

    .game_box {
        padding: 16px;
    }

    .game_item {
        padding: 14px;
        gap: 12px;
    }

    .game_icon {
        width: 48px;
        height: 48px;
    }

    .game_info h4 {
        font-size: 16px;
    }

    .game_desc {
        font-size: 12px;
    }

    .order_btn {
        padding: 14px 20px;
        font-size: 16px;
        min-height: 48px;
    }

    .user-link {
        padding: 10px 16px;
        font-size: 14px;
    }

    .back-btn {
        padding: 8px 14px;
        font-size: 13px;
    }
}

/* 超小屏优化 */
@media (max-width: 375px) {
    .wrap {
        padding: 8px;
    }

    .card {
        padding: 12px;
    }

    .game_item {
        padding: 12px;
        flex-wrap: wrap;
    }

    .game_info {
        width: 100%;
        order: 2;
    }

    .game_arrow {
        order: 1;
    }
}

/* 安全区域适配 */
@supports (padding: max(0px)) {
    .wrap {
        padding-left: max(12px, env(safe-area-inset-left));
        padding-right: max(12px, env(safe-area-inset-right));
        padding-bottom: max(40px, env(safe-area-inset-bottom));
    }
}

/* ========== 全局移动端兼容增强 ========== */
html, body {
    overscroll-behavior-y: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

a {
    -webkit-tap-highlight-color: transparent;
}

img {
    max-width: 100%;
    height: auto;
    vertical-align: middle;
}
