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

:root {
    /* Apple-style Color Palette */
    --primary-color: #007AFF;
    --secondary-color: #5856D6;
    --success-color: #34C759;
    --warning-color: #FF9500;
    --error-color: #FF3B30;
    --background-color: #FFFFFF;
    --surface-color: #F2F2F7;
    --text-primary: #1D1D1F;
    --text-secondary: #6E6E73;
    --border-color: #D2D2D7;
    --shadow-light: 0 2px 10px rgba(0, 0, 0, 0.05);
    --shadow-medium: 0 4px 20px rgba(0, 0, 0, 0.1);
    --border-radius: 12px;
    --border-radius-large: 20px;
    --transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background-color);
    font-size: 16px;
}

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

/* Header Styles */
.header {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.logo h1 a {
    text-decoration: none;
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: 32px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 16px;
    transition: var(--transition);
    padding: 8px 0;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
    border-radius: 1px;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
}

.bar {
    width: 24px;
    height: 2px;
    background-color: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--surface-color) 0%, rgba(120, 119, 198, 0.1) 100%);
    padding: 80px 0;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    min-height: 400px;
}

.hero-text {
    text-align: left;
}

.hero-image {
    text-align: center;
}

.hero-img {
    width: 100%;
    max-width: 500px;
    height: auto;
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-medium);
    transition: var(--transition);
    background: var(--surface-color);
    min-height: 280px;
}

.hero-img:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

/* Placeholder for missing images */
.hero-image::after {
    content: "🎾 游戏截图即将添加";
    display: block;
    text-align: center;
    padding: 120px 20px;
    background: var(--surface-color);
    border-radius: var(--border-radius-large);
    color: var(--text-secondary);
    font-size: 18px;
    border: 2px dashed var(--border-color);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.hero-image {
    position: relative;
}

/* Hide placeholder when image loads successfully */
.hero-image:has(.hero-img[src]:not([src=""])) ::after {
    display: none;
}

/* Fallback for browsers that don't support :has() */
.hero-image.image-loaded::after {
    display: none;
}

.hero-title {
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 20px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
}

/* Section Styles */
.section-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.section-description {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 40px;
    line-height: 1.6;
}

/* Codes Section */
.codes-section {
    padding: 80px 0;
}

.codes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 60px;
}

.code-card {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.code-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
    border-color: var(--primary-color);
}

.code-card.new::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--success-color), var(--primary-color));
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.code-name {
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--surface-color);
    padding: 6px 12px;
    border-radius: 8px;
}

.new-badge {
    background: linear-gradient(135deg, var(--success-color), #30D158);
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.code-rewards {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.copy-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    font-size: 16px;
}

.copy-btn:hover {
    background: #0056CC;
    transform: translateY(-1px);
}

.copy-btn:active {
    transform: translateY(0);
}

/* Expired Codes */
.expired-codes {
    margin-top: 60px;
    padding: 32px;
    background: var(--surface-color);
    border-radius: var(--border-radius);
}

.expired-codes h3 {
    font-size: 24px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.expired-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.expired-code {
    background: var(--background-color);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 8px;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 14px;
    text-decoration: line-through;
    border: 1px solid var(--border-color);
}

/* How-to Section */
.how-to-section {
    padding: 80px 0;
    background: var(--surface-color);
}

.redeem-visual {
    text-align: center;
    margin: 40px 0;
}

.redeem-img {
    width: 100%;
    max-width: 600px;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-medium);
    border: 1px solid var(--border-color);
}

.image-caption {
    margin-top: 12px;
    color: var(--text-secondary);
    font-size: 14px;
    font-style: italic;
}

/* Image placeholders */
.image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--surface-color);
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 40px 20px;
    color: var(--text-secondary);
    text-align: center;
}

.hero-placeholder {
    min-height: 280px;
    border-radius: var(--border-radius-large);
}

.placeholder-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.placeholder-text {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.placeholder-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 32px;
    margin-top: 40px;
}

.step-card {
    background: var(--background-color);
    padding: 32px 24px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.step-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-medium);
}

.step-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    margin: 0 auto 16px;
}

.step-card h3 {
    font-size: 20px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.step-card p {
    color: var(--text-secondary);
    line-height: 1.5;
}

/* More Codes Section */
.more-codes-section {
    padding: 80px 0;
}

.social-links {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 40px;
    flex-wrap: wrap;
}

.social-link {
    display: inline-flex;
    align-items: center;
    padding: 16px 24px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    color: white;
    min-width: 200px;
    justify-content: center;
}

.social-link.discord {
    background: linear-gradient(135deg, #5865F2, #4752C4);
}

.social-link.twitter {
    background: linear-gradient(135deg, #1DA1F2, #0D8BD9);
}

.social-link.bookmark {
    background: linear-gradient(135deg, var(--warning-color), #FF8C00);
}

.social-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* What Codes & Troubleshooting Sections */
.what-codes-section,
.troubleshooting-section {
    padding: 80px 0;
}

.what-codes-section {
    background: var(--surface-color);
}

.reward-types,
.troubleshooting-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 40px;
}

.reward-card,
.trouble-card {
    background: var(--background-color);
    padding: 24px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.reward-card:hover,
.trouble-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
    border-color: var(--primary-color);
}

.reward-card h4,
.trouble-card h4 {
    font-size: 18px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.reward-card p,
.trouble-card p {
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Footer */
.footer {
    background: var(--text-primary);
    color: white;
    padding: 60px 0 20px;
}

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

.footer-section h4 {
    font-size: 18px;
    margin-bottom: 16px;
    font-weight: 600;
}

.footer-section p {
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
}

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

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section ul li a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
}

.footer-section ul li a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--text-primary);
    color: white;
    padding: 16px 24px;
    border-radius: var(--border-radius);
    transform: translateX(400px);
    transition: var(--transition);
    z-index: 10000;
    font-weight: 500;
}

.toast.show {
    transform: translateX(0);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 64px;
        flex-direction: column;
        background-color: var(--background-color);
        width: 100%;
        text-align: center;
        transition: var(--transition);
        box-shadow: var(--shadow-medium);
        border-bottom: 1px solid var(--border-color);
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-list {
        flex-direction: column;
        padding: 20px 0;
        gap: 0;
    }

    .nav-list li {
        padding: 16px 0;
    }

    .hamburger {
        display: flex;
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }

    .hero {
        padding: 60px 0;
    }

    .hero-content {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }

    .hero-text {
        text-align: center;
    }

    .codes-section,
    .how-to-section,
    .more-codes-section,
    .what-codes-section,
    .troubleshooting-section {
        padding: 60px 0;
    }

    .section-title {
        font-size: 28px;
    }

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

    .steps-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .social-links {
        flex-direction: column;
        align-items: center;
    }

    .social-link {
        width: 100%;
        max-width: 300px;
    }

    .reward-types,
    .troubleshooting-list {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }

    .toast {
        left: 20px;
        right: 20px;
        transform: translateY(100px);
    }

    .toast.show {
        transform: translateY(0);
    }
}

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

    .nav-container {
        padding: 0 16px;
    }

    .hero {
        padding: 40px 0;
    }

    .hero-title {
        font-size: 32px;
    }

    .hero-description {
        font-size: 18px;
    }

    .code-card,
    .step-card,
    .reward-card,
    .trouble-card {
        padding: 20px;
    }

    .expired-codes {
        padding: 24px;
    }

    .section-title {
        font-size: 24px;
    }
}

/* Dark mode media query */
@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #000000;
        --surface-color: #1C1C1E;
        --text-primary: #FFFFFF;
        --text-secondary: #98989D;
        --border-color: #38383A;
    }
    
    .header {
        background-color: rgba(28, 28, 30, 0.95);
    }
    
    .nav-menu {
        background-color: var(--surface-color);
    }
}

/* Language Selector */
.language-selector {
    position: relative;
    margin-left: 20px;
}

.language-dropdown {
    position: relative;
}

.language-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

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

.dropdown-arrow {
    font-size: 10px;
    transition: transform 0.3s ease;
}

.language-btn.active .dropdown-arrow {
    transform: rotate(180deg);
}

.language-options {
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 10px 0;
    min-width: 150px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.language-options.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    padding: 10px 20px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    color: #fff;
    font-size: 14px;
}

.language-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.language-option.active {
    background: rgba(255, 107, 107, 0.2);
    color: #ff6b6b;
}

/* Mobile responsiveness for language selector */
@media (max-width: 768px) {
    .language-selector {
        margin-left: 0;
        margin-top: 10px;
    }
    
    .nav-menu.active .language-selector {
        display: block;
    }
    
    .language-options {
        position: fixed;
        top: auto;
        right: 20px;
        left: 20px;
        width: auto;
    }
} 