/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

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

/* 头部样式 */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header h1 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 10px;
}

header p {
    text-align: center;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

/* 导航栏样式 */
nav {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    padding: 15px 0;
}

nav ul li {
    margin: 0 20px;
}

nav ul li a {
    text-decoration: none;
    color: #333;
    font-weight: bold;
    font-size: 1.1rem;
    transition: color 0.3s ease;
}

nav ul li a:hover {
    color: #667eea;
}

/* 介绍部分样式 */
.intro {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    text-align: center;
}

.intro p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 20px;
}

.contact-info {
    font-weight: bold;
    color: #667eea;
}

/* 游戏部分样式 */
.games-section {
    margin-bottom: 40px;
}

.section-title {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: #333;
}

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

.game-card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* 游戏组合样式 */
.game-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 攻略卡片样式 */
.strategy-card {
    background-color: #f8f9fa;
    border-left: 4px solid #667eea;
}

.game-image {
    width: 100%;
    height: auto;
    max-height: 300px;
    object-fit: contain;
}

.game-info {
    padding: 20px;
}

.game-info h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: #333;
}

.game-info p {
    margin-bottom: 15px;
    color: #666;
}

.btn {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* 搜索页样式 */
.search-section {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.search-form {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.search-form input {
    width: 400px;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 5px 0 0 5px;
    font-size: 1rem;
}

.search-form button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 0 5px 5px 0;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

.search-form button:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.search-results {
    margin-top: 30px;
}

.search-results h3 {
    margin-bottom: 20px;
    color: #333;
}

.game-list {
    list-style: none;
}

.game-list li {
    padding: 15px;
    border-bottom: 1px solid #ddd;
    transition: background-color 0.3s ease;
}

.game-list li:hover {
    background-color: #f5f5f5;
}

.game-list li a {
    text-decoration: none;
    color: #333;
    font-weight: bold;
    display: block;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

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

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

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

/* 底部样式 */
footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
}

footer p {
    margin-bottom: 10px;
}

footer a {
    color: #667eea;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* 响应式设计 - 平板和手机 */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    header p {
        font-size: 0.95rem;
    }
    
    nav ul {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    nav ul li {
        margin: 5px 15px;
    }
    
    .search-form input {
        width: 100%;
        max-width: 280px;
    }
    
    .games-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .game-group {
        gap: 10px;
    }
    
    .btn {
        padding: 14px 24px;
        font-size: 1rem;
        width: 100%;
        text-align: center;
        min-height: 48px;
        -webkit-tap-highlight-color: transparent;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 92%;
        max-height: 80vh;
        overflow-y: auto;
    }
    
    .game-image {
        max-height: 250px;
    }
}

/* 响应式设计 - 小屏手机 */
@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }
    
    header {
        padding: 15px 0;
    }
    
    header h1 {
        font-size: 1.5rem;
        margin-bottom: 8px;
    }
    
    header p {
        font-size: 0.85rem;
        margin-bottom: 15px;
    }
    
    nav {
        margin-bottom: 20px;
    }
    
    nav ul {
        padding: 10px 0;
    }
    
    nav ul li {
        margin: 5px 10px;
    }
    
    nav ul li a {
        font-size: 0.95rem;
    }
    
    .intro {
        padding: 18px;
        margin-bottom: 20px;
    }
    
    .intro p {
        font-size: 0.95rem;
        line-height: 1.7;
        margin-bottom: 15px;
    }
    
    .section-title {
        font-size: 1.3rem;
        margin-bottom: 20px;
    }
    
    .games-section {
        margin-bottom: 30px;
    }
    
    .game-card {
        border-radius: 6px;
    }
    
    .game-image {
        max-height: 200px;
    }
    
    .game-info {
        padding: 12px;
    }
    
    .game-info h3 {
        font-size: 1.1rem;
        margin-bottom: 8px;
    }
    
    .game-info p {
        font-size: 0.85rem;
        margin-bottom: 12px;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 0.95rem;
        min-height: 44px;
    }
    
    .search-section {
        padding: 20px;
    }
    
    .search-form {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-form input {
        width: 100%;
        border-radius: 5px;
        padding: 14px;
        font-size: 16px;
    }
    
    .search-form button {
        width: 100%;
        border-radius: 5px;
        padding: 14px;
    }
    
    .modal-content {
        margin: 5% auto;
        width: 94%;
        padding: 15px;
        border-radius: 10px;
    }
    
    .modal-content h3 {
        font-size: 1.2rem;
    }
    
    .form-group {
        margin-bottom: 12px;
    }
    
    .form-group label {
        font-size: 0.9rem;
    }
    
    .form-group input {
        padding: 14px;
        font-size: 16px;
        border-radius: 6px;
    }
    
    .close {
        font-size: 24px;
    }
    
    footer {
        padding: 15px 0;
        margin-top: 30px;
    }
    
    footer p {
        font-size: 0.85rem;
        margin-bottom: 8px;
    }
}

/* iPhone SE/5/5S/5C 等小屏设备 */
@media (max-width: 320px) {
    header h1 {
        font-size: 1.3rem;
    }
    
    .section-title {
        font-size: 1.2rem;
    }
    
    .game-info h3 {
        font-size: 1rem;
    }
}

/* 华为等安卓设备优化 */
@media screen and (-webkit-min-device-pixel-ratio: 2),
       screen and (min-resolution: 192dpi) {
    .btn,
    .game-card,
    .modal-content {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
}