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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

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

/* Header and Navigation */
header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav {
    padding: 20px 0;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #007bff;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
}

.logo a {
    text-decoration: none;
    color: #007bff;
}

.hamburger {
    display: none;
    cursor: pointer;
}

.hamburger .line {
    width: 25px;
    height: 3px;
    background-color: #333;
    margin: 5px;
    transition: all 0.3s ease;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 80px 0;
}

.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
}

.hero-img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.hero-content {
    max-width: 600px;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

/* Buttons */
.btn-primary {
    display: inline-block;
    padding: 12px 30px;
    background-color: #28a745;
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: #218838;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(40, 167, 69, 0.2);
}

.btn-secondary {
    display: inline-block;
    padding: 12px 30px;
    background-color: transparent;
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid white;
    margin-left: 15px;
}

.btn-secondary:hover {
    background-color: white;
    color: #007bff;
}

.btn-primary.large {
    font-size: 1.2rem;
    padding: 15px 40px;
}

/* Features Section */
.features {
    padding: 80px 0;
    background-color: white;
}

.features h2 {
    text-align: center;
    margin-bottom: 50px;
    font-size: 2.2rem;
    color: #333;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature-item {
    text-align: center;
    padding: 30px;
    background-color: #f8f9fa;
    border-radius: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.feature-item h3 {
    margin-bottom: 15px;
    font-size: 1.3rem;
}

/* Game Preview Section */
.game-preview {
    padding: 80px 0;
    background-color: #f8f9fa;
}

.game-preview h2 {
    text-align: center;
    margin-bottom: 50px;
    font-size: 2.2rem;
}

.preview-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 50px;
}

.preview-img {
    max-width: 100%;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.preview-info {
    flex: 1;
}

.preview-info h3 {
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.preview-info ul {
    margin-bottom: 30px;
    padding-left: 20px;
}

.preview-info li {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

/* Testimonials */
.testimonials {
    padding: 80px 0;
    background-color: white;
}

.testimonials h2 {
    text-align: center;
    margin-bottom: 50px;
    font-size: 2.2rem;
}

.testimonials-slider {
    display: flex;
    gap: 30px;
    overflow-x: auto;
    padding-bottom: 20px;
}

.testimonial-item {
    flex: 0 0 350px;
    padding: 30px;
    background-color: #f8f9fa;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.testimonial-item p {
    font-style: italic;
    margin-bottom: 20px;
}

.author-name {
    font-weight: 600;
    margin-bottom: 5px;
}

.author-rating {
    color: #ffc107;
}

/* CTA Section */
.cta {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 80px 0;
    text-align: center;
}

.cta h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.cta p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Footer */
footer {
    background-color: #343a40;
    color: white;
    padding: 50px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-logo h3 {
    margin-bottom: 10px;
    color: #007bff;
}

.footer-links h4 {
    margin-bottom: 15px;
    color: #fff;
}

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

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    text-decoration: none;
    color: #adb5bd;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #007bff;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #495057;
    color: #adb5bd;
}

/* Game Page Styles */
.game-container {
    padding: 50px 0;
    text-align: center;
}

.game-header {
    margin-bottom: 30px;
}

.game-controls {
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.difficulty-buttons button {
    padding: 10px 20px;
    margin: 0 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    background-color: #007bff;
    color: white;
    transition: background-color 0.3s ease;
}

.difficulty-buttons button:hover {
    background-color: #0056b3;
}

.difficulty-buttons button.active {
    background-color: #28a745;
}

.game-board {
    display: inline-block;
    padding: 20px;
    background-color: #c0c0c0;
    border: 3px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
}

.board-row {
    display: flex;
}

.board-cell {
    width: 30px;
    height: 30px;
    border: 1px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
    background-color: #c0c0c0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    transition: all 0.1s ease;
}

.board-cell.revealed {
    background-color: #e0e0e0;
    border: 1px solid #a0a0a0;
    transition: background-color 0.2s ease;
}

/* Add hover effect for better UX */
.board-cell:not(.revealed):not(.flagged):hover {
    background-color: #d0d0d0;
    transform: scale(1.05);
    transition: all 0.1s ease;
}

.board-cell.flagged {
    color: #dc3545;
    font-weight: bold;
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

.board-cell.mine {
    background-color: #dc3545;
    color: white;
}

.board-cell.exploded-mine {
    background-color: #ff0000;
    box-shadow: 0 0 10px #ff0000;
    animation: explode 0.3s ease;
}

.board-cell.incorrect-flag {
    background-color: #ffc107;
    color: #dc3545;
}

/* Animation for mine explosion */
@keyframes explode {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Number colors */
.board-cell.number-1 { color: #0000ff; }
.board-cell.number-2 { color: #008000; }
.board-cell.number-3 { color: #ff0000; }
.board-cell.number-4 { color: #000080; }
.board-cell.number-5 { color: #800000; }
.board-cell.number-6 { color: #008080; }
.board-cell.number-7 { color: #000000; }
.board-cell.number-8 { color: #808080; }

/* Game stats */
.game-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 20px;
    font-size: 1.2rem;
}

/* Reset button styles */
#reset-button {
    font-size: 1.8rem;
    padding: 5px 20px;
    background-color: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#reset-button:hover {
    background-color: #e9ecef;
    transform: scale(1.1);
}

.timer, .mines-counter {
    background-color: #000;
    color: #ff0000;
    padding: 5px 15px;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
}

/* Result modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    padding: 40px;
    border-radius: 10px;
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.modal-content h2 {
    margin-bottom: 20px;
}

.modal-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 30px;
}

/* About, Contact, Privacy, Terms Pages */
.page-content {
    padding: 60px 0;
    background-color: white;
}

.page-content h1 {
    margin-bottom: 30px;
    font-size: 2.5rem;
    color: #333;
}

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

.page-content h2 {
    margin-top: 40px;
    margin-bottom: 20px;
    font-size: 1.8rem;
    color: #444;
}

.page-content h3 {
    margin-top: 30px;
    margin-bottom: 15px;
    font-size: 1.4rem;
    color: #555;
}

.page-content ul, .page-content ol {
    margin-bottom: 20px;
    padding-left: 25px;
}

.page-content li {
    margin-bottom: 10px;
}

/* Blog Page Styles */
.blog-content {
    padding: 60px 0;
}

.blog-content h1 {
    text-align: center;
    margin-bottom: 50px;
    font-size: 2.5rem;
}

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

.blog-post {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-post:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.blog-post-image {
    height: 200px;
    overflow: hidden;
}

.blog-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-post:hover .blog-post-image img {
    transform: scale(1.05);
}

.blog-post-content {
    padding: 25px;
}

.blog-post-date {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.blog-post h2 {
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.blog-post p {
    margin-bottom: 20px;
    color: #555;
}

.blog-post a {
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.blog-post a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Blog Post Detail Page */
.blog-detail-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 0;
}

.blog-detail-header {
    margin-bottom: 40px;
}

.blog-detail-image {
    width: 100%;
    height: 400px;
    overflow: hidden;
    border-radius: 10px;
    margin-bottom: 30px;
}

.blog-detail-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .hamburger {
        display: block;
    }

    .nav-links {
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background-color: white;
        flex-direction: column;
        align-items: center;
        padding: 20px;
        box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
        transform: translateY(-150%);
        transition: transform 0.3s ease;
        z-index: -1;
    }

    .nav-links.active {
        transform: translateY(0);
    }

    .hero {
        padding: 60px 0;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero-content {
        text-align: center;
        max-width: 100%;
    }
    
    .hero-image {
        margin-top: 20px;
    }
    
    .hero-img {
        max-height: 250px;
        width: auto;
    }

    .preview-container {
        flex-direction: column;
        text-align: center;
    }

    .preview-img {
        width: 100%;
        height: auto;
        max-width: 300px;
        margin: 0 auto 20px;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .game-stats {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .difficulty-buttons {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .difficulty-buttons button {
        padding: 10px 15px;
        font-size: 0.9rem;
    }

    .board-cell {
        width: 25px;
        height: 25px;
        font-size: 0.9rem;
    }

    .game-board {
        max-width: 100%;
        overflow-x: auto;
        padding: 10px 0;
    }

    .blog-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .blog-detail-image {
        height: 250px;
    }

    .modal-content {
        padding: 30px 20px;
        margin: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .hero {
        padding: 40px 0;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }
    
    .hero-img {
        max-height: 200px;
        width: auto;
    }

    .btn-primary, .btn-secondary {
        padding: 10px 20px;
        margin-bottom: 10px;
        width: 100%;
        max-width: 300px;
        margin-left: auto;
        margin-right: auto;
        display: block;
    }

    h2 {
        font-size: 1.8rem;
    }

    h3 {
        font-size: 1.4rem;
    }

    .board-cell {
        width: 20px;
        height: 20px;
        font-size: 0.8rem;
        /* 优化触摸体验 */
        touch-action: manipulation;
    }

    .game-instructions ul {
        padding-left: 20px;
    }

    .game-instructions li {
        font-size: 0.9rem;
        margin-bottom: 8px;
    }

    .game-header p {
        font-size: 0.9rem;
    }

    .timer, .mines-counter {
        font-size: 1rem;
        padding: 5px 10px;
    }

    #reset-button {
        font-size: 1.5rem;
        min-width: 40px;
        height: 40px;
    }

    .page-content h1 {
        font-size: 2rem;
    }

    .page-content p {
        font-size: 1rem;
    }
}

/* 平板设备样式调整 */
@media (min-width: 769px) and (max-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .board-cell {
        touch-action: manipulation;
        min-width: 30px;
        min-height: 30px;
    }

    /* 为触摸设备添加更大的交互区域 */
    button, a {
        touch-action: manipulation;
    }

    /* 优化移动端点击反馈 */
    .board-cell:active:not(.revealed):not(.flagged) {
        transform: scale(0.95);
    }
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.feature-item, .blog-post, .testimonial-item {
    animation: fadeIn 0.6s ease-out;
}

.feature-item:nth-child(2) { animation-delay: 0.2s; }
.feature-item:nth-child(3) { animation-delay: 0.4s; }
.feature-item:nth-child(4) { animation-delay: 0.6s; }