/* Apple Worm Pro - CSS Styles */
/* 苹果风格的现代化设计，支持响应式布局 */

/* CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #1C1C1E;
    background: linear-gradient(135deg, #F2F2F7 0%, #FFFFFF 100%);
    min-height: 100vh;
}

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

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #007AFF 0%, #34C759 100%);
    color: white;
    padding: 80px 0 80px; /* 增加底部间距 */
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 0; /* 确保没有额外的底部边距 */
}

.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"><circle cx="20" cy="20" r="2" fill="%23ffffff" opacity="0.1"/><circle cx="80" cy="40" r="1" fill="%23ffffff" opacity="0.1"/><circle cx="40" cy="80" r="1.5" fill="%23ffffff" opacity="0.1"/></svg>') repeat;
    animation: float 20s ease-in-out infinite;
}

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

.game-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}

.game-subtitle {
    font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    font-weight: 400;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto 1.5rem;
    position: relative;
    z-index: 1;
}

/* 快速导航样式 */
.quick-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.9rem;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
    color: #f0f0f0;
}

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

/* 移动端导航优化 */
@media (max-width: 768px) {
    .quick-nav {
        gap: 0.5rem;
    }
    
    .nav-link {
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
    }
    
    /* 移动端游戏区域优化 */
    .hero-section {
        padding: 60px 0 60px;
    }
    
    .game-section {
        padding: 60px 0 80px;
    }
    
    .game-container {
        padding: 20px;
        margin: 0 10px;
    }
    
    .game-section-title {
        font-size: clamp(1.5rem, 4vw, 2rem);
        margin-bottom: 8px;
    }
    
    .game-section-subtitle {
        font-size: 1rem;
        padding: 0 10px;
    }
    
    .game-wrapper {
        margin-top: 15px;
    }
}

/* Game Section */
.game-section {
    padding: 80px 0 100px; /* 增加顶部和底部间距 */
    background: #FFFFFF;
    position: relative;
    margin-top: 0;
}

/* 在游戏区域顶部添加装饰性分隔 */
.game-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, #007AFF, #34C759);
    border-radius: 2px;
}

.game-container {
    max-width: 1200px; /* 放大1.5倍: 800px * 1.5 = 1200px */
    margin: 0 auto;
    padding: 40px;
    background: linear-gradient(135deg, #F8F9FA 0%, #FFFFFF 100%);
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 122, 255, 0.1);
    position: relative;
}

.game-wrapper {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: #F2F2F7;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    border: 2px solid rgba(0, 122, 255, 0.2);
    margin-top: 20px;
}

/* 游戏区域标题样式 */
.game-section-title {
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    font-weight: 700;
    color: #1C1C1E;
    text-align: center;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #007AFF, #34C759);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.game-section-subtitle {
    font-size: 1.1rem;
    color: #666;
    text-align: center;
    margin-bottom: 0;
    font-weight: 400;
    line-height: 1.5;
}

#gameFrame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 12px;
}

/* Loading Indicator */
.loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #007AFF;
    z-index: 10;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #F2F2F7;
    border-top: 4px solid #007AFF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

/* Content Sections */
.description-section,
.guide-section,
.features-section,
.tips-section {
    padding: 60px 0;
}

.description-section {
    background: #F2F2F7;
}

.overview-section {
    padding: 4rem 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.guide-section {
    background: #FFFFFF;
}

.features-section {
    background: linear-gradient(135deg, #F2F2F7 0%, #E5E5EA 100%);
}

.tips-section {
    background: #FFFFFF;
}

/* Content Cards */
.content-card {
    background: #FFFFFF;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.description-section .content-card {
    background: linear-gradient(135deg, #FFFFFF 0%, #F8F9FA 100%);
}

.overview-section .content-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.overview-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.highlight-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(52, 199, 89, 0.1);
    border-radius: 12px;
    border-left: 4px solid #34c759;
    transition: all 0.3s ease;
}

.highlight-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 199, 89, 0.2);
}

.highlight-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

/* Headings */
h2 {
    font-size: clamp(1.8rem, 3vw, 2.2rem);
    font-weight: 600;
    color: #1C1C1E;
    margin-bottom: 25px;
    text-align: center;
}

h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1C1C1E;
    margin-bottom: 12px;
}

/* Paragraphs */
p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #3A3A3C;
    margin-bottom: 20px;
}

/* Guide Steps */
.guide-intro {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 2rem;
    text-align: center;
}

.guide-steps {
    margin-top: 2rem;
}

.step-item {
    display: flex;
    gap: 2rem;
    margin-bottom: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 16px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.step-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-color: #34c759;
}

.step-number {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #34c759, #30d158);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(52, 199, 89, 0.3);
}

.step-content {
    flex: 1;
}

.step-content h3 {
    margin-bottom: 1rem;
    color: #1d1d1f;
}

.controls-table {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1rem;
}

.control-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #e9ecef;
}

.control-row:last-child {
    border-bottom: none;
}

.control-action {
    font-weight: 600;
    color: #1d1d1f;
}

.control-key {
    background: #34c759;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
}

.battlefield-list,
.mechanics-list {
    list-style: none;
    padding: 0;
    margin-top: 1rem;
}

.battlefield-list li,
.mechanics-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
    line-height: 1.6;
}

.battlefield-list li:last-child,
.mechanics-list li:last-child {
    border-bottom: none;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.feature-item {
    background: #FFFFFF;
    padding: 35px 25px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(52, 199, 89, 0.1);
    transition: all 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(52, 199, 89, 0.15);
}

.feature-icon {
    font-size: 2.2rem;
    margin-bottom: 15px;
    display: block;
}

/* Tips & Tricks Section */
.tips-intro {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 2rem;
    text-align: center;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.tip-category {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 2rem;
    border-radius: 16px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.tip-category:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-color: #34c759;
}

.tip-category h3 {
    color: #1d1d1f;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #34c759;
}

.tips-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tips-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
    line-height: 1.6;
    font-size: 0.95rem;
}

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

.tips-list li strong {
    color: #34c759;
    font-weight: 600;
}

/* Why Play Here Section */
.why-play-section {
    background: linear-gradient(135deg, #F2F2F7 0%, #E5E5EA 100%);
    padding: 4rem 0;
}

.why-intro {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 2rem;
    text-align: center;
}

.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.benefit-item {
    background: #ffffff;
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(52, 199, 89, 0.1);
    transition: all 0.3s ease;
}

.benefit-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(52, 199, 89, 0.15);
    border-color: #34c759;
}

.benefit-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
    color: #34c759;
}

.benefit-item h3 {
    color: #1d1d1f;
    margin-bottom: 1rem;
    text-align: center;
}

.benefit-item p {
    color: #666;
    line-height: 1.6;
    margin: 0;
}

/* Footer */
.footer {
    background: #1C1C1E;
    color: #F2F2F7;
    padding: 40px 0;
    text-align: center;
}

/* 友情链接样式 */
.friends-links {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(242, 242, 247, 0.2);
}

.friends-links h3 {
    color: #F2F2F7;
    font-size: 1.2rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.links-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
}

.friend-link {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    background: rgba(0, 122, 255, 0.1);
    border: 1px solid rgba(0, 122, 255, 0.3);
    border-radius: 25px;
    color: #007AFF;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.friend-link:hover {
    background: rgba(0, 122, 255, 0.2);
    border-color: #007AFF;
    color: #34C759;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.2);
}

.footer-copyright {
    margin-top: 10px;
}

.footer p {
    margin: 0;
    font-size: 0.95rem;
    opacity: 0.8;
}

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

.footer a:hover {
    color: #34C759;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .hero-section {
        padding: 60px 0 40px;
    }
    
    .content-card {
        padding: 30px 25px;
    }
    
    .overview-highlights {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .step-item {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .step-number {
        align-self: center;
    }
    
    .controls-table {
        padding: 1rem;
    }
    
    .control-row {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .feature-item {
        padding: 25px 20px;
    }
    
    .tips-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .tip-category {
        padding: 1.5rem;
    }
    
    .benefits-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .benefit-item {
        padding: 1.5rem;
    }
    
    .description-section,
    .guide-section,
    .features-section,
    .tips-section {
        padding: 40px 0;
    }
    
    .guide-intro,
    .tips-intro,
    .why-intro {
        font-size: 1rem;
    }
    
    /* 友情链接响应式 */
    .friends-links {
        margin-bottom: 20px;
        padding-bottom: 15px;
    }
    
    .friends-links h3 {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }
    
    .links-container {
        gap: 15px;
    }
    
    .friend-link {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .game-wrapper {
        border-radius: 15px;
    }
    
    #gameFrame {
        border-radius: 15px;
    }
    
    .content-card {
        padding: 20px 15px;
        border-radius: 15px;
    }
    
    .step-item {
        padding: 1.5rem;
    }
    
    .tip-category,
    .benefit-item {
        padding: 1rem;
    }
    
    .benefit-icon {
        font-size: 2rem;
    }
    
    .step-number {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .feature-item {
        border-radius: 12px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .hero-section::before {
        animation: none;
    }
}

/* Focus styles for better accessibility */
a:focus,
button:focus {
    outline: 2px solid #007AFF;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .content-card {
        border: 2px solid #1C1C1E;
    }
    
    .guide-item,
    .feature-item {
        border: 2px solid #007AFF;
    }
}

.title-icon {
    width: 1.2em;
    height: 1.2em;
    vertical-align: middle;
    margin-right: 0.3em;
    display: inline-block;
}