/* ============================================
   星际游戏站 - 太空科幻风样式
   ============================================ */

/* 通用重置 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1f4e 100%);
    min-height: 100vh;
    color: #fff;
    overflow-x: hidden;
}

/* ============================================
   星星背景动画
   ============================================ */
.stars-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* 月球背景 */
.stars-bg .moon {
    position: absolute;
    top: 8%;
    right: 10%;
    width: 120px;
    height: 120px;
    font-size: 100px;
    line-height: 120px;
    text-align: center;
    animation: moon-float 6s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(255, 240, 200, 0.6));
    z-index: 1;
}

@keyframes moon-float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
}

@media (max-width: 768px) {
    .stars-bg .moon {
        width: 80px;
        height: 80px;
        font-size: 70px;
        top: 5%;
        right: 5%;
    }
}

.stars-bg::before,
.stars-bg::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
}

.stars-bg::before {
    background-image:
        radial-gradient(2px 2px at 20px 30px, #fff, transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 90px 40px, #fff, transparent),
        radial-gradient(2px 2px at 160px 120px, rgba(255,255,255,0.6), transparent),
        radial-gradient(1px 1px at 230px 80px, #fff, transparent),
        radial-gradient(2px 2px at 300px 150px, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 380px 50px, #fff, transparent),
        radial-gradient(2px 2px at 450px 180px, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 520px 90px, #fff, transparent),
        radial-gradient(2px 2px at 600px 130px, rgba(255,255,255,0.8), transparent);
    background-repeat: repeat;
    background-size: 650px 250px;
    animation: stars-move 100s linear infinite;
}

.stars-bg::after {
    background-image:
        radial-gradient(1px 1px at 50px 60px, rgba(0, 212, 255, 0.8), transparent),
        radial-gradient(1px 1px at 150px 100px, rgba(123, 45, 255, 0.6), transparent),
        radial-gradient(1px 1px at 250px 30px, rgba(0, 212, 255, 0.7), transparent),
        radial-gradient(1px 1px at 350px 140px, rgba(123, 45, 255, 0.5), transparent),
        radial-gradient(1px 1px at 500px 80px, rgba(0, 212, 255, 0.6), transparent);
    background-repeat: repeat;
    background-size: 550px 200px;
    animation: stars-move 150s linear infinite reverse;
}

@keyframes stars-move {
    from { transform: translateY(0); }
    to { transform: translateY(-250px); }
}

/* ============================================
   霓虹发光效果
   ============================================ */
.neon-text {
    color: #00d4ff;
    text-shadow: 0 0 10px #00d4ff, 0 0 20px #00d4ff66;
}

.glow-border {
    border: 1px solid rgba(0, 212, 255, 0.3);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.1), inset 0 0 15px rgba(0, 212, 255, 0.05);
}

/* ============================================
   玻璃态卡片
   ============================================ */
.glass-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 16px;
}

/* ============================================
   按钮样式
   ============================================ */
.btn-neon {
    background: transparent;
    border: 1px solid #00d4ff;
    color: #00d4ff;
    padding: 10px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn-neon:hover {
    background: rgba(0, 212, 255, 0.15);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.4);
    transform: translateY(-2px);
}

.btn-neon.danger {
    border-color: #ff3366;
    color: #ff3366;
}

.btn-neon.danger:hover {
    background: rgba(255, 51, 102, 0.15);
    box-shadow: 0 0 20px rgba(255, 51, 102, 0.4);
}

.btn-neon.success {
    border-color: #00ff88;
    color: #00ff88;
}

.btn-neon.success:hover {
    background: rgba(0, 255, 136, 0.15);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
}

.btn-neon.purple {
    border-color: #7b2dff;
    color: #7b2dff;
}

.btn-neon.purple:hover {
    background: rgba(123, 45, 255, 0.15);
    box-shadow: 0 0 20px rgba(123, 45, 255, 0.4);
}

/* ============================================
   导航栏
   ============================================ */
.navbar {
    position: relative;
    z-index: 100;
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(10, 14, 39, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
}

.navbar .logo {
    font-size: 24px;
    font-weight: bold;
    color: #00d4ff;
    text-shadow: 0 0 10px #00d4ff, 0 0 20px #00d4ff66;
    text-decoration: none;
}

.navbar .nav-links {
    display: flex;
    gap: 30px;
    list-style: none;
}

.navbar .nav-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s;
    font-size: 14px;
}

.navbar .nav-links a:hover {
    color: #00d4ff;
    text-shadow: 0 0 10px #00d4ff;
}

/* ============================================
   英雄区域
   ============================================ */
.hero {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 80px 20px;
}

.hero h1 {
    font-size: 48px;
    color: #00d4ff;
    text-shadow: 0 0 20px #00d4ff, 0 0 40px #00d4ff44;
    margin-bottom: 20px;
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { text-shadow: 0 0 20px #00d4ff, 0 0 40px #00d4ff44; }
    50% { text-shadow: 0 0 30px #00d4ff, 0 0 60px #00d4ff66; }
}

.hero p {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.7);
}

/* ============================================
   游戏卡片区
   ============================================ */
.games-section {
    position: relative;
    z-index: 1;
    padding: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.games-section h2 {
    font-size: 32px;
    color: #00d4ff;
    margin-bottom: 30px;
    text-shadow: 0 0 10px #00d4ff44;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}

/* 游戏卡片 */
.game-card {
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 16px;
}

.game-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.3);
    border-color: #00d4ff;
}

.game-card .card-cover {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
    border-radius: 16px 16px 0 0;
    position: relative;
    overflow: hidden;
}

.game-card .card-cover::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(10, 14, 39, 0.9), transparent);
}

.game-card .card-info {
    padding: 20px;
}

.game-card .card-info h3 {
    font-size: 18px;
    color: #00d4ff;
    margin-bottom: 8px;
}

.game-card .card-info .author {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 8px;
}

.game-card .card-info .desc {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 24px;
}

/* ============================================
   游戏播放页
   ============================================ */
.play-container {
    position: relative;
    z-index: 1;
    padding: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.play-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.play-header h1 {
    font-size: 32px;
    color: #00d4ff;
    text-shadow: 0 0 10px #00d4ff44;
}

.game-frame {
    width: 100%;
    height: 75vh;
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 16px;
    overflow: hidden;
    background: #000;
}

.game-frame iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* ============================================
   表单样式
   ============================================ */
.form-container {
    position: relative;
    z-index: 1;
    max-width: 500px;
    margin: 80px auto;
    padding: 40px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 16px;
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.1);
}

.form-container h2 {
    text-align: center;
    font-size: 28px;
    color: #00d4ff;
    margin-bottom: 30px;
    text-shadow: 0 0 10px #00d4ff44;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #00d4ff;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.2);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-group input[type="file"] {
    padding: 8px;
    cursor: pointer;
}

.form-group input[type="file"]::file-selector-button {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    color: #00d4ff;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    margin-right: 10px;
    transition: all 0.3s;
}

.form-group input[type="file"]::file-selector-button:hover {
    background: rgba(0, 212, 255, 0.2);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

/* ============================================
   表格样式（后台管理）
   ============================================ */
.admin-container {
    position: relative;
    z-index: 1;
    padding: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.admin-header h1 {
    font-size: 32px;
    color: #00d4ff;
    text-shadow: 0 0 10px #00d4ff44;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    overflow: hidden;
}

.admin-table thead {
    background: rgba(0, 212, 255, 0.1);
}

.admin-table th {
    padding: 15px;
    text-align: left;
    color: #00d4ff;
    font-size: 14px;
    font-weight: 600;
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
}

.admin-table td {
    padding: 15px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-table tbody tr:hover {
    background: rgba(0, 212, 255, 0.05);
}

.admin-actions {
    display: flex;
    gap: 10px;
}

/* ============================================
   图片预览
   ============================================ */
.image-preview {
    width: 200px;
    height: 150px;
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 8px;
    overflow: hidden;
    margin-top: 10px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.image-preview .placeholder {
    color: rgba(255, 255, 255, 0.3);
    font-size: 14px;
}

/* ============================================
   页脚
   ============================================ */
.footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
    border-top: 1px solid rgba(0, 212, 255, 0.1);
    margin-top: 80px;
}

/* ============================================
   提示消息
   ============================================ */
.message {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.message.success {
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid rgba(0, 255, 136, 0.3);
    color: #00ff88;
}

.message.error {
    background: rgba(255, 51, 102, 0.1);
    border: 1px solid rgba(255, 51, 102, 0.3);
    color: #ff3366;
}

.message.info {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    color: #00d4ff;
}

/* ============================================
   加载动画
   ============================================ */
.loading {
    text-align: center;
    padding: 40px;
    color: rgba(255, 255, 255, 0.5);
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

/* ============================================
   响应式设计
   ============================================ */
@media (max-width: 768px) {
    .navbar {
        padding: 15px 20px;
        flex-direction: column;
        gap: 15px;
    }

    .navbar .nav-links {
        gap: 15px;
    }

    .hero h1 {
        font-size: 32px;
    }

    .hero p {
        font-size: 16px;
    }

    .games-section {
        padding: 20px;
    }

    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 20px;
    }

    .play-container {
        padding: 20px;
    }

    .game-frame {
        height: 60vh;
    }

    .admin-container {
        padding: 20px;
    }

    .admin-table {
        display: block;
        overflow-x: auto;
    }
}
