/* General Body Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Container improvements */
.container {
    position: relative;
    z-index: 1;
}

/* Loading animation */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Responsive improvements */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .hero-section p {
        font-size: 1.1rem;
    }
    
    .game-details {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }
    
    .search-input {
        padding: 15px 50px 15px 20px;
        font-size: 1rem;
    }
    
    .search-button {
        width: 40px;
        height: 40px;
    }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px 0 20px;
}

/* 主页容器特殊处理 */
.homepage-container {
    padding-right: 0;
}

/* Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.navbar-brand {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    transition: all 0.3s ease;
}

.navbar-brand:hover {
    transform: scale(1.05);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('/images/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: white;
    text-align: center;
    padding: 100px 20px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
    min-height: 400px;
}

.hero-section.no-image {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 50%, #ff9ff3 100%);
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="%23ffffff" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>') repeat;
    pointer-events: none;
    opacity: 0.3;
}

.hero-section h1 {
    font-size: 4rem;
    font-weight: 900;
    margin-bottom: 20px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.hero-section p {
    font-size: 1.4rem;
    margin-bottom: 40px;
    opacity: 0.9;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Search Bar */
.search-container {
    max-width: 700px;
    margin: 0 auto 40px;
    position: relative;
    animation: fadeInUp 1s ease-out 0.4s both;
}

.search-container form {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-input {
    flex: 1;
    padding: 20px 25px;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    outline: none;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.search-input:focus {
    transform: translateY(-2px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 1);
}

.search-input::placeholder {
    color: #999;
    font-weight: 500;
}

.search-button {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    border: none;
    border-radius: 25px;
    padding: 20px 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
}

.search-button:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(255, 107, 107, 0.4);
}

/* Category Filter */
.category-filter {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 50px;
    animation: fadeInUp 1s ease-out 0.6s both;
}

.category-chip {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    color: #333;
    border-radius: 25px;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: none;
}

.category-chip::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.category-chip:hover::before {
    left: 100%;
}

.category-chip:hover {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}
.category-chip:hover,
.category-chip.active {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.3);
}

/* Main Content Wrapper */
.main-content-wrapper {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 50px;
    align-items: start;
}

/* Game Grid */
.game-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    padding-bottom: 50px;
    animation: fadeInUp 1s ease-out 0.8s both;
    flex: 1;
    max-width: calc(100% - 340px);
}

/* Hot Games Sidebar */
.hot-games-sidebar {
    animation: fadeInUp 1s ease-out 1s both;
    width: 300px;
    flex-shrink: 0;
}

.hot-games-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: sticky;
    top: 120px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
}

.hot-games-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #333;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hot-games-title i {
    color: #ff6b6b;
    font-size: 1.2rem;
}

.hot-games-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.hot-game-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
}

.hot-game-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.hot-game-item a {
    display: flex;
    text-decoration: none;
    color: inherit;
    padding: 12px;
    gap: 12px;
}

.hot-game-item .image-container {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f8f9fa;
}

.hot-game-item .image-container::before {
    display: none;
}

.hot-game-item img {
    position: static;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.hot-game-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.hot-game-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 5px 0;
    color: #333;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hot-game-category {
    font-size: 0.8rem;
    color: #666;
    background: #f8f9fa;
    padding: 2px 8px;
    border-radius: 12px;
    align-self: flex-start;
}

.no-hot-games {
    text-align: center;
    color: #999;
    font-style: italic;
    margin: 20px 0;
}

/* Responsive Design */
@media (min-width: 1800px) {
    .container {
        max-width: 1600px;
    }
    
    .game-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1600px) {
    .game-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1200px) {
    .game-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .main-content-wrapper {
        flex-direction: column;
        gap: 30px;
    }
    
    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        max-width: none;
    }
    
    .hot-games-sidebar {
        order: -1;
        width: 100%;
    }
    
    .hot-games-container {
        position: static;
        max-height: none;
    }
    
    .hot-games-list {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 15px;
    }
}

.game-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    border: 1px solid #e0e0e0;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1), rgba(238, 90, 36, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.game-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

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

.game-card a {
    text-decoration: none;
    color: inherit;
}

.game-card img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    object-position: center;
    display: block;
    transition: transform 0.4s ease;
    background: #f8f9fa;
}

.game-card:hover img {
    transform: scale(1.05);
}

.game-card .game-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    position: relative;
    z-index: 1;
}

.game-card h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 12px 0;
    color: #333;
    line-height: 1.3;
}

.game-date {
    font-size: 0.8rem;
    color: #65676b;
    margin: 0 0 10px 0;
}

.category-tag {
    background-color: #e7f3ff;
    color: #1877f2;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    align-self: flex-start;
    margin-top: auto;
}

/* Game Details Page */
.game-details-container {
    display: flex;
    flex-direction: column;
    gap: 50px;
    animation: fadeInUp 1s ease-out;
    margin-top: 30px;
    padding-top: 20px;
}

.game-main-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 40px;
}

.game-gallery {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 30px;
  border-radius: 20px;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
}

.game-gallery::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.05), rgba(238, 90, 36, 0.05));
    pointer-events: none;
}

.swiper {
  width: 100%;
  height: 400px;
  margin-bottom: 15px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  position: relative;
}

.swiper-wrapper {
  height: 100%;
}

.swiper-slide {
  display: flex;
  justify-content: center;
  align-items: center;
  background: #f8f9fa;
  border-radius: 8px;
}

.swiper-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: 8px;
  background: #f8f9fa;
}

.swiper-pagination {
  bottom: 15px !important;
}

.swiper-pagination-bullet {
  background: rgba(255, 255, 255, 0.7);
  opacity: 1;
  width: 12px;
  height: 12px;
  margin: 0 6px;
  transition: all 0.3s ease;
}

.swiper-pagination-bullet-active {
  background: #ff6b6b;
  transform: scale(1.2);
}

.swiper-button-next,
.swiper-button-prev {
  color: #ff6b6b;
  background: rgba(255, 255, 255, 0.9);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  margin-top: -22px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
  background: rgba(255, 255, 255, 1);
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.swiper-button-next::after,
.swiper-button-prev::after {
  font-size: 18px;
  font-weight: bold;
}

.game-meta {
  margin-bottom: 15px;
}

.release-date {
  font-size: 0.9rem;
  color: #666;
}

.game-gallery h1 {
  margin-top: 0;
}

.game-description {
  line-height: 1.6;
}

.game-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.download-section, .tutorial-section {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 25px;
  border-radius: 20px;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.download-section:hover, .tutorial-section:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.download-section h2, .tutorial-section h2 {
  margin-top: 0;
  border-bottom: 2px solid #eee;
  padding-bottom: 10px;
  margin-bottom: 15px;
}

.download-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.download-button {
  display: block;
  padding: 15px 20px;
  color: white;
  text-align: center;
  border-radius: 15px;
  font-weight: bold;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  text-decoration: none;
}

.download-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.download-button:hover::before {
  left: 100%;
}

.download-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
  text-decoration: none;
}

.download-button.quark { background-color: #28a745; }
.download-button.uc { background-color: #ffc107; color: #333; }
.download-button.baidu { background-color: #17a2b8; }

.tutorial-content {
  line-height: 1.6;
}

.tutorial-button {
  display: inline-block;
  padding: 15px 25px;
  background: linear-gradient(45deg, #6f42c1, #8e44ad);
  color: white;
  text-decoration: none;
  border-radius: 15px;
  font-weight: bold;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.tutorial-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.tutorial-button:hover::before {
  left: 100%;
}

.tutorial-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(111, 66, 193, 0.3);
  text-decoration: none;
  color: white;
}



/* Footer */
footer {
    text-align: center;
    margin-top: 60px;
    padding: 40px 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
    color: #666;
    font-weight: 500;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

/* Admin Categories Page */
.categories-list {
  list-style: none;
  padding: 0;
}

.categories-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid #eee;
}

.categories-list li:last-child {
  border-bottom: none;
}

.delete-btn {
  background: #dc3545;
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
}

.delete-btn:hover {
  background: #c82333;
}

.form-inline {
  display: flex;
  gap: 10px;
}

.form-inline input[type="text"] {
  flex-grow: 1;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 5px;
}

.form-inline button {
  padding: 8px 15px;
  background: #28a745;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.form-inline button:hover {
  background: #218838;
}

/* Admin Forms and Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.table th, .table td {
  padding: 12px;
  border: 1px solid #ddd;
  text-align: left;
}

.table th {
  background-color: #f2f2f2;
}

.btn {
  padding: 8px 12px;
  border-radius: 5px;
  text-decoration: none;
  color: white;
  cursor: pointer;
  border: none;
}

.btn-primary { background-color: #007bff; }
.btn-warning { background-color: #ffc107; color: #333; }
.btn-danger { background-color: #dc3545; }
.btn-sm { padding: 5px 10px; font-size: 0.9rem; }

.mt-4 { margin-top: 1.5rem; }

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

.form-group label {
  display: block;
  margin-bottom: 5px;
}

.form-control {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 5px;
}