/* 
 * IndieGameHub - Main Stylesheet
 * A professional game portal with responsive design
 */

/* ======== Base Styles ======== */
:root {
    /* Light theme (default) */
    --primary-color: #ff6f61;
    --secondary-color: #4a90e2;
    --text-primary: #333333;
    --text-secondary: #666666;
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --header-bg: #ffffff;
    --footer-bg: #2c3e50;
    --footer-text: #ecf0f1;
    --border-color: #e0e0e0;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --hover-shadow: rgba(0, 0, 0, 0.2);
    --accent-color: #ff6f61;
    --accent-hover: #e0655a;
    --button-secondary-bg: #f0f0f0;
    --button-secondary-hover: #e0e0e0;
    --button-secondary-text: #333333;
    --category-btn-bg: #f0f0f0;
    --category-active-bg: #ff6f61;
    --category-active-text: #ffffff;
    --tag-bg: #f0f0f0;
    --tag-text: #666666;
}

.dark-mode, [data-theme="dark"] {
    --primary-color: #ff7e73;
    --secondary-color: #64b5f6;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --bg-color: #1a1a1a;
    --card-bg: #2c2c2c;
    --header-bg: #2c2c2c;
    --footer-bg: #0f1620;
    --footer-text: #ecf0f1;
    --border-color: #444444;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --hover-shadow: rgba(0, 0, 0, 0.4);
    --accent-color: #ff7e73;
    --accent-hover: #ff8f85;
    --button-secondary-bg: #3a3a3a;
    --button-secondary-hover: #4a4a4a;
    --button-secondary-text: #e0e0e0;
    --category-btn-bg: #3a3a3a;
    --category-active-bg: #ff7e73;
    --category-active-text: #ffffff;
    --tag-bg: #3a3a3a;
    --tag-text: #e0e0e0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'SF Pro Display', 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-color);
    transition: background-color 0.5s, color 0.5s;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Open Sans', 'Roboto', sans-serif;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.3;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.3s ease;
}

a:hover {
    color: var(--btn-hover);
}

img {
    max-width: 100%;
    height: auto;
}

button {
    cursor: pointer;
    border: none;
    outline: none;
    font-family: inherit;
}

.page-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    padding: 2rem 1rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* ======== Animations ======== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ======== Header ======== */
.site-header {
    background-color: var(--header-bg);
    box-shadow: 0 2px 10px var(--shadow-color);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color 0.5s;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.logo a {
    display: flex;
    align-items: center;
    color: var(--text-primary);
    font-weight: bold;
    font-size: 1.2rem;
}

.logo h1 {
    margin: 0;
    font-size: 1.5rem;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.main-nav {
    display: flex;
    align-items: center;
}

.nav-menu {
    display: flex;
    list-style: none;
}

.nav-menu li {
    margin-left: 1.5rem;
}

.nav-menu a {
    color: var(--text-primary);
    font-weight: 500;
    position: relative;
    padding: 0.5rem 0;
}

.nav-menu a:after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.3s;
}

.nav-menu a:hover:after,
.nav-menu a.active:after {
    width: 100%;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: var(--text-primary);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.theme-toggle {
    margin-left: 1.5rem;
}

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

.theme-toggle button:hover {
    background-color: var(--border-color);
}

.sun-icon {
    display: none;
}

.moon-icon {
    display: block;
}

[data-theme="dark"] .sun-icon {
    display: block;
}

[data-theme="dark"] .moon-icon {
    display: none;
}

/* ======== Hero Section ======== */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 3rem 0.5rem;
    text-align: center;
    border-radius: 0 0 10px 10px;
    margin-bottom: 2rem;
    animation: fadeIn 0.5s ease;
}

.hero-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 10px;
}

.hero-title {
    font-size: 2.2rem;
    margin-bottom: 1.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hero-description {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    opacity: 0.9;
    text-align: left;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 0.5rem;
    }
    
    .hero-title {
        font-size: 1.8rem;
        white-space: normal;
    }
    
    .hero-description {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding: 1.5rem 0.5rem;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
}

/* ======== Categories Section ======== */
.categories-section {
    margin: 2rem 0;
    text-align: center;
    animation: fadeIn 0.5s ease;
}

.category-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 1rem;
}

.category-btn {
    background-color: var(--category-btn-bg);
    border: none;
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.category-btn:hover {
    background-color: rgba(255, 111, 97, 0.2);
    transform: translateY(-2px);
}

.category-btn.active {
    background-color: #ff6f61;
    color: white;
    box-shadow: 0 4px 8px rgba(255, 111, 97, 0.3);
}

/* ======== Games Grid ======== */
.games-section {
    animation: fadeIn 0.5s ease;
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin-top: 1.5rem;
    animation: fadeIn 0.5s ease;
}

.game-card {
    background-color: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    box-shadow: none;
    border-radius: 0;
}

.game-thumbnail {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 8px var(--shadow-color);
}

.game-card:hover .game-thumbnail {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.game-info {
    padding-top: 8px;
    width: 100%;
    text-align: center;
}

.game-title {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0;
    color: var(--text-primary);
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.5rem;
}

.game-categories-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 0.5rem;
}

.game-category {
    font-size: 0.75rem;
    background-color: var(--category-btn-bg);
    padding: 2px 8px;
    border-radius: 10px;
    color: var(--text-primary);
}

/* 游戏卡片链接样式 */
.game-card a {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-primary);
    width: 100%;
    position: relative;
}

/* 新标签打开指示器 */
.game-card a::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    position: absolute;
    top: 5px;
    right: 5px;
    border: 5px solid transparent;
    border-top-color: var(--primary-color);
    border-right-color: var(--primary-color);
    opacity: 0;
    transform: rotate(45deg);
    transition: opacity 0.3s ease;
}

.game-card:hover a::after {
    opacity: 0.8;
}

/* ======== Pagination ======== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.pagination ul {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pagination li {
    margin: 0 3px;
}

.pagination a, .pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background-color: #f5f5f5;
    border-color: #d0d0d0;
}

.pagination .active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    cursor: default;
}

.pagination .disabled {
    color: #ccc;
    cursor: not-allowed;
}

[data-theme="dark"] .pagination a:hover {
    background-color: #333;
    border-color: #444;
}

/* ======== Loading Spinner ======== */
.loading-spinner {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    margin-top: 20px;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

/* ======== Game Detail Page ======== */
.game-detail {
    background-color: var(--card-bg);
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    padding: 40px;
    margin-bottom: 40px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.game-detail:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(to right, var(--accent-color), var(--secondary-color));
}

.dark-mode .game-detail {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.breadcrumbs {
    font-size: 14px;
    color: #999;
    margin-bottom: 1.5rem;
}

.breadcrumbs a {
    color: #999;
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumbs a:hover {
    color: var(--primary-color);
}

.game-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.game-header {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
}

.game-thumbnail {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.game-title-info {
    flex: 1;
}

.game-title-info h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #000;
}

.game-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.game-category-tag {
    background-color: #f2f2f2;
    color: #333;
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    font-size: 14px;
    display: inline-block;
}

.game-description h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #333;
}

.game-description p {
    font-size: 16px;
    line-height: 1.6;
    color: #555;
    margin-bottom: 1.5rem;
}

.game-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.play-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to right, #007aff, #00c6ff);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.8rem 2rem;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.2);
}

.play-btn:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 6px 16px rgba(0, 122, 255, 0.3);
}

.play-btn:active {
    transform: translateY(0) scale(0.98);
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f5f5;
    color: #333;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 0.8rem 1.5rem;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
}

.share-btn:hover {
    background-color: #e9e9e9;
    transform: translateY(-2px);
}

.share-btn:active {
    transform: translateY(0) scale(0.98);
}

/* Similar Games Section */
.similar-games {
    margin-bottom: 3rem;
}

.similar-games h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #333;
}

.similar-games-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* Dark theme overrides for game detail */
[data-theme="dark"] .game-detail {
    background-color: #222;
}

[data-theme="dark"] .game-title-info h1 {
    color: #f5f5f5;
}

[data-theme="dark"] .game-category-tag {
    background-color: #333;
    color: #ddd;
}

[data-theme="dark"] .game-description h2,
[data-theme="dark"] .similar-games h2 {
    color: #e0e0e0;
}

[data-theme="dark"] .game-description p {
    color: #aaa;
}

[data-theme="dark"] .share-btn {
    background-color: #333;
    color: #e0e0e0;
    border-color: #444;
}

[data-theme="dark"] .share-btn:hover {
    background-color: #444;
}

/* Error Message */
.error-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    padding: 2rem;
}

.error-message {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    text-align: center;
    max-width: 500px;
}

.error-message h2 {
    font-size: 24px;
    color: #e74c3c;
    margin-bottom: 1rem;
}

.error-message p {
    font-size: 16px;
    color: #555;
    margin-bottom: 1.5rem;
}

.error-actions {
    display: flex;
    justify-content: center;
}

/* Responsive Design for Game Detail Page */
@media (max-width: 768px) {
    .game-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1.5rem;
    }
    
    .game-thumbnail {
        width: 160px;
        height: 160px;
    }
    
    .game-title-info h1 {
        font-size: 28px;
    }
    
    .game-categories {
        justify-content: center;
    }
    
    .similar-games-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .game-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .play-btn, .share-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .game-detail {
        padding: 1.5rem;
    }
    
    .game-thumbnail {
        width: 120px;
        height: 120px;
    }
    
    .game-title-info h1 {
        font-size: 24px;
    }
    
    .game-description h2,
    .similar-games h2 {
        font-size: 20px;
    }
    
    .similar-games-grid {
        grid-template-columns: repeat(1, 1fr);
    }
}

/* ======== Play Game Page ======== */
.play-page {
    background-color: var(--bg-color);
}

.play-header {
    background-color: rgba(44, 62, 80, 0.9);
    color: white;
}

.play-header .logo a,
.play-header .nav-menu a {
    color: white;
}

.game-title-play h2 {
    margin: 0;
    color: white;
    font-size: 1.2rem;
}

.play-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.control-btn {
    background: none;
    border: none;
    color: white;
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.play-content {
    padding: 0;
    max-width: 100%;
}

.game-frame-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

.game-frame-wrapper {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 62.5%; /* 16:10 aspect ratio */
    background-color: black;
    border-radius: 10px;
    overflow: hidden;
}

#game-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    gap: 1rem;
    z-index: 10;
}

.play-footer {
    background-color: var(--card-bg);
    padding: 2rem 1rem;
    margin-top: 2rem;
}

.more-games {
    max-width: 1200px;
    margin: 0 auto;
}

.more-games h3 {
    margin-bottom: 1.5rem;
}

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

/* ======== Footer ======== */
.site-footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    padding: 3rem 1rem 1rem;
    margin-top: 3rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    margin-bottom: 2rem;
}

.footer-logo h2 {
    font-size: 1.8rem;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.footer-links h3,
.footer-categories h3 {
    color: var(--footer-text);
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.footer-links ul,
.footer-categories ul {
    list-style: none;
}

.footer-links li,
.footer-categories li {
    margin-bottom: 0.5rem;
}

.footer-links a,
.footer-categories a {
    color: var(--footer-text);
    opacity: 0.8;
    transition: opacity 0.3s;
}

.footer-links a:hover,
.footer-categories a:hover {
    opacity: 1;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 1200px;
    margin: 0 auto;
}

.footer-bottom p {
    opacity: 0.7;
    font-size: 0.9rem;
}

/* ======== Responsive Styles ======== */
@media (max-width: 1200px) {
    .games-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-wrap: wrap;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--header-bg);
        flex-direction: column;
        box-shadow: 0 4px 8px var(--shadow-color);
        padding: 1rem;
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-menu li {
        margin: 0;
        padding: 0.5rem 0;
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-menu li:last-child {
        border-bottom: none;
    }
    
    .hero-content h2 {
        font-size: 1.8rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .games-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }
    
    .play-page .header-container {
        padding: 0.5rem 1rem;
    }
    
    .game-title-play {
        display: none;
    }
    
    .game-thumbnail {
        width: 110px;
        height: 110px;
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding: 2rem 1rem;
    }
    
    .hero-content h2 {
        font-size: 1.5rem;
    }
    
    .search-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-container input {
        border-radius: 20px;
    }
    
    .search-container button {
        border-radius: 20px;
    }
    
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .game-thumbnail {
        width: 100px;
        height: 100px;
    }
    
    .game-title {
        font-size: 0.8rem;
        height: 2.4rem;
    }
    
    .category-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .game-title-info h1 {
        font-size: 1.5rem;
    }
    
    .game-detail {
        padding: 1rem;
    }
    
    .game-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .similar-games-grid,
    .more-games-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.no-games-found {
    grid-column: 1 / -1;
    text-align: center;
    padding: 30px;
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 4px 8px var(--shadow-color);
    margin-top: 20px;
}

.no-games-found h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

/* ======== Game Detail Page Styles ======== */
.breadcrumbs {
    margin: 20px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.breadcrumbs a {
    color: var(--accent-color);
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.game-detail {
    background-color: var(--card-bg);
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    padding: 40px;
    margin-bottom: 40px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.game-detail:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(to right, var(--accent-color), var(--secondary-color));
}

.dark-mode .game-detail {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.game-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 25px;
}

.game-thumbnail {
    width: 180px;
    height: 180px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.game-thumbnail:hover {
    transform: scale(1.02);
}

.game-title-info {
    margin-left: 25px;
    flex: 1;
}

.game-title-info h1 {
    margin: 0 0 15px 0;
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
}

.game-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.game-category {
    background-color: var(--tag-bg);
    color: var(--tag-text);
    font-size: 13px;
    font-weight: 500;
    padding: 5px 12px;
    border-radius: 100px;
    display: inline-block;
}

.game-description {
    margin-bottom: 25px;
}

.game-description h2 {
    font-size: 20px;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.game-description p {
    line-height: 1.7;
    color: var(--text-secondary);
    margin: 0;
}

.game-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.play-btn {
    background-color: var(--accent-color);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 100px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.play-btn:hover {
    background-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.share-btn {
    background-color: var(--button-secondary-bg);
    color: var(--button-secondary-text);
    font-size: 16px;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 100px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.share-btn:hover {
    background-color: var(--button-secondary-hover);
}

.similar-games-section {
    margin: 50px 0;
}

.similar-games-section h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 30px;
    padding-bottom: 15px;
    position: relative;
    color: var(--text-primary);
}

.similar-games-section h2:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(to right, var(--accent-color), var(--secondary-color));
    border-radius: 2px;
}

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

.error-message {
    text-align: center;
    padding: 40px 20px;
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.error-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.error-message h2 {
    color: var(--text-primary);
    margin-bottom: 15px;
}

.error-message p {
    color: var(--text-secondary);
    margin-bottom: 25px;
}

.error-btn {
    background-color: var(--accent-color);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 100px;
    display: inline-block;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.error-btn:hover {
    background-color: var(--accent-hover);
}

.error-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* ======== Game Play Page Styles ======== */
.game-play-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background-color: var(--header-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.site-logo {
    font-size: 22px;
    font-weight: 700;
    color: var(--accent-color);
    text-decoration: none;
}

#game-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.game-controls {
    display: flex;
    gap: 10px;
}

.control-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background-color: var(--button-secondary-bg);
    color: var(--button-secondary-text);
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-btn:hover {
    background-color: var(--button-secondary-hover);
}

.control-btn svg {
    width: 18px;
    height: 18px;
}

.game-play-main {
    height: calc(100vh - 170px);
    padding: 0;
    display: flex;
    flex-direction: column;
}

.game-container {
    position: relative;
    width: 100%;
    height: 100%;
    background-color: #000;
    overflow: hidden;
}

#game-frame {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

.loading-overlay p {
    color: #fff;
    font-size: 16px;
    font-weight: 500;
}

.game-play-footer {
    padding: 20px 25px;
    background-color: var(--card-bg);
}

.more-games h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: var(--text-primary);
}

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

.game-suggestion {
    transition: transform 0.2s ease;
}

.game-suggestion:hover {
    transform: translateY(-3px);
}

.game-suggestion a {
    display: flex;
    flex-direction: column;
    text-decoration: none;
}

.game-suggestion img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 8px;
}

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

/* ======== Responsive Styles for Game Pages ======== */
@media (max-width: 768px) {
    .game-header {
        flex-direction: column;
    }
    
    .game-thumbnail {
        width: 100%;
        max-width: 280px;
        height: auto;
        margin-bottom: 20px;
    }
    
    .game-title-info {
        margin-left: 0;
    }
    
    .game-controls {
        flex-wrap: wrap;
    }
    
    .control-btn {
        font-size: 13px;
        padding: 6px 10px;
    }
    
    .control-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .game-play-main {
        height: calc(100vh - 200px);
    }
}

@media (max-width: 480px) {
    .game-detail {
        padding: 15px;
    }
    
    .game-title-info h1 {
        font-size: 22px;
    }
    
    .game-actions {
        flex-direction: column;
    }
    
    .header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .site-logo {
        font-size: 18px;
    }
    
    #game-title {
        font-size: 16px;
    }
    
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 游戏详情页新样式 - 左右布局 */
.game-details-layout {
    display: flex;
    flex-direction: row;
    gap: 40px;
    width: 100%;
}

.game-details-left {
    flex: 0 0 40%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.game-details-right {
    flex: 0 0 60%;
    display: flex;
    flex-direction: column;
    padding-left: 20px;
    border-left: 1px solid var(--border-color);
}

.game-image-container {
    width: 100%;
    margin-bottom: 25px;
}

.game-detail-thumbnail {
    width: 85%;
    height: auto;
    max-height: 350px;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.game-detail-thumbnail:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}

.game-detail-title {
    font-family: 'SF Pro Display', Arial, sans-serif;
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -0.5px;
    text-transform: uppercase;
    margin: 0 0 20px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.game-detail-actions {
    margin-top: 30px;
    width: 100%;
    display: flex;
    justify-content: center;
}

.game-detail-actions .play-btn {
    padding: 16px 40px;
    font-size: 20px;
    font-weight: 800;
    border-radius: 12px;
    background: linear-gradient(to right, var(--accent-color), #ff8f70);
    letter-spacing: 1px;
    text-transform: uppercase;
    animation: pulse 2s infinite;
    transition: all 0.3s ease;
    box-shadow: 0 8px 16px rgba(255, 111, 97, 0.3);
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 8px 16px rgba(255, 111, 97, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 12px 24px rgba(255, 111, 97, 0.4);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 8px 16px rgba(255, 111, 97, 0.3);
    }
}

.game-detail-actions .play-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 30px rgba(255, 111, 97, 0.4);
    background: linear-gradient(to right, #ff8f70, var(--accent-color));
}

.about-game-title {
    font-family: 'SF Pro Display', Arial, sans-serif;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 25px;
    padding-bottom: 15px;
    position: relative;
    color: var(--text-primary);
}

.about-game-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(to right, var(--accent-color), var(--secondary-color));
    border-radius: 2px;
}

.game-description-text {
    font-size: 18px;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 30px;
    text-align: left;
}

.game-description-text p {
    margin-bottom: 15px;
}

.game-share {
    margin-top: auto;
    align-self: flex-start;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--button-secondary-bg);
    color: var(--button-secondary-text);
    font-size: 16px;
    padding: 12px 25px;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.share-btn:before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='18' cy='5' r='3'/%3E%3Ccircle cx='6' cy='12' r='3'/%3E%3Ccircle cx='18' cy='19' r='3'/%3E%3Cline x1='8.59' y1='13.51' x2='15.42' y2='17.49'/%3E%3Cline x1='15.41' y1='6.51' x2='8.59' y2='10.49'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

.share-btn:hover {
    background-color: var(--button-secondary-hover);
    transform: translateY(-2px);
}

/* 适配深色模式 */
.dark-mode .game-details-right {
    border-left-color: rgba(255, 255, 255, 0.1);
}

/* 响应式调整 */
@media (max-width: 900px) {
    .game-details-layout {
        flex-direction: column;
        gap: 30px;
    }
    
    .game-details-left, 
    .game-details-right {
        flex: 0 0 100%;
        padding: 0;
        border-left: none;
    }
    
    .game-details-right {
        border-top: 1px solid var(--border-color);
        padding-top: 30px;
    }
    
    .dark-mode .game-details-right {
        border-top-color: rgba(255, 255, 255, 0.1);
    }
    
    .game-detail-thumbnail {
        width: 80%;
        max-height: 300px;
    }
}

@media (max-width: 480px) {
    .game-detail-title {
        font-size: 28px;
    }
    
    .about-game-title {
        font-size: 24px;
    }
    
    .game-description-text {
        font-size: 16px;
    }
    
    .game-detail-actions .play-btn {
        padding: 14px 30px;
        font-size: 18px;
    }
}

.empty-card {
    visibility: hidden;
}

/* 导航栏搜索框样式 */
.header-search {
    display: flex;
    align-items: center;
    margin-right: 15px;
    max-width: 200px;
}

.header-search input {
    height: 32px;
    border: 1px solid var(--border-color);
    border-radius: 16px 0 0 16px;
    padding: 0 10px;
    font-size: 0.85rem;
    width: 150px;
    outline: none;
    background-color: var(--bg-color);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.header-search input:focus {
    border-color: var(--primary-color);
}

.header-search button {
    height: 32px;
    border: 1px solid var(--border-color);
    border-left: none;
    border-radius: 0 16px 16px 0;
    padding: 0 10px;
    background-color: var(--bg-color);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.header-search button:hover {
    background-color: var(--border-color);
}

/* 响应式适配 */
@media (max-width: 1024px) {
    .header-search {
        max-width: 150px;
    }
    
    .header-search input {
        width: 100px;
    }
    
    .hero-title {
        font-size: 2rem;
        white-space: normal;
    }
}

@media (max-width: 768px) {
    .header-search {
        display: none;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .hero-section {
        padding: 2rem 0.5rem;
    }
}

/* 添加占位图和加载失败图片的样式 */
.game-thumbnail.fallback-image {
    border: 1px dashed var(--border-color);
    background-color: rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

[data-theme="dark"] .game-thumbnail.fallback-image {
    background-color: rgba(255, 255, 255, 0.05);
}

.game-thumbnail.fallback-image::before {
    content: "\2613";  /* 图片不可用符号 */
    font-size: 2rem;
    color: var(--text-secondary);
    opacity: 0.5;
    position: absolute;
}

/* 图片加载中动画 */
@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 0.8; }
    100% { opacity: 0.6; }
}

.game-thumbnail.loading {
    animation: pulse 1.5s infinite;
}

/* 数据加载通知和重试按钮 */
.data-load-notice {
    background-color: var(--warning-bg-color, #fff3cd);
    color: var(--warning-text-color, #856404);
    border: 1px solid var(--warning-border-color, #ffeeba);
    border-radius: 6px;
    padding: 15px;
    margin: 15px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.data-load-notice p {
    margin: 0;
    flex: 1;
}

#retry-load-btn, .retry-button {
    background-color: var(--primary-color, #4a89dc);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 15px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s;
    margin-left: 10px;
}

#retry-load-btn:hover, .retry-button:hover {
    background-color: var(--primary-color-dark, #3b71b8);
}

/* 错误消息样式 */
.error-message {
    text-align: center;
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.error-message h3 {
    color: var(--error-color, #dc3545);
    margin-bottom: 15px;
}

[data-theme="dark"] .data-load-notice {
    background-color: var(--dark-warning-bg-color, #2c2a1e);
    color: var(--dark-warning-text-color, #e0d9b5);
    border-color: var(--dark-warning-border-color, #65591c);
}

/* 确保在移动设备上显示良好 */
@media (max-width: 768px) {
    .data-load-notice {
        flex-direction: column;
        align-items: flex-start;
    }
    
    #retry-load-btn, .retry-button {
        margin-left: 0;
        margin-top: 10px;
    }
} 