:root {
    --color-primary: #c41e3a;
    --color-secondary: #ffd700;
    --color-dark: #1a1a1a;
    --color-light: #f5f5f5;
    --color-text: #333;
    --color-text-light: #666;
}

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

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

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

/* Header */
.site-header {
    background: var(--color-dark);
    color: #fff;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
}

.logo-chinese {
    color: var(--color-secondary);
    font-size: 2rem;
}

.main-nav {
    display: flex;
    gap: 2rem;
}

.main-nav a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.main-nav a:hover {
    color: var(--color-secondary);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
}

.mobile-menu {
    display: none;
    flex-direction: column;
    background: var(--color-dark);
    padding: 1rem 0;
}

.mobile-menu a {
    color: #fff;
    text-decoration: none;
    padding: 0.75rem 2rem;
    transition: background 0.3s;
}

.mobile-menu a:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--color-primary) 0%, #8b1428 100%);
    color: #fff;
    padding: 6rem 0;
    text-align: center;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.chinese-accent {
    font-size: 4rem;
    color: var(--color-secondary);
    display: block;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    padding: 1rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--color-secondary);
    color: var(--color-dark);
}

.btn-primary:hover {
    background: #ffed4e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 2px solid #fff;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

.btn-large {
    padding: 1.25rem 2.5rem;
    font-size: 1.125rem;
}

/* Gallery Section */
.gallery-section {
    padding: 5rem 0;
    background: var(--color-light);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 900;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--color-dark);
}

.section-subtitle {
    text-align: center;
    color: var(--color-text-light);
    font-size: 1.125rem;
    margin-bottom: 3rem;
}

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

.ideogram-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    cursor: pointer;
}

.ideogram-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 24px rgba(196, 30, 58, 0.2);
}

.ideogram-image-wrapper {
    background: #f9f9f9;
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 300px;
}

.ideogram-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.ideogram-info {
    padding: 1.5rem;
}

.ideogram-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.ideogram-meaning {
    color: var(--color-text-light);
    line-height: 1.6;
}

/* Modal - FIXED VERSION */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    padding: 2rem;
    overflow: auto;
}

/* Force flex display when JavaScript sets it */
.modal[style*="display: flex"],
.modal[style*="display:flex"] {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.modal-content {
    max-width: 1000px;
    width: 100%;
    max-height: 90vh;
    background: #fff;
    border-radius: 12px;
    overflow: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem;
    position: relative;
    animation: modalFadeIn 0.3s;
    margin: auto;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-content img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    border-radius: 8px;
}

.modal-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.modal-info h2 {
    font-size: 2rem;
    color: var(--color-primary);
    margin-bottom: 1rem;
}

.modal-info p {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--color-text);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: var(--color-text);
    font-size: 3rem;
    font-weight: 300;
    cursor: pointer;
    z-index: 10001;
    transition: color 0.3s;
    line-height: 1;
    background: none;
    border: none;
    padding: 0;
}

.modal-close:hover {
    color: var(--color-primary);
}

/* About Section */
.about-section {
    padding: 5rem 0;
}

.about-content p {
    font-size: 1.125rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: var(--color-text);
}

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

.feature-item {
    text-align: center;
    padding: 2rem;
    background: var(--color-light);
    border-radius: 12px;
}

.feature-item i {
    font-size: 3rem;
    color: var(--color-primary);
    margin-bottom: 1rem;
}

.feature-item h4 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--color-dark);
}

.feature-item p {
    color: var(--color-text-light);
    font-size: 1rem;
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, var(--color-primary) 0%, #8b1428 100%);
    color: #fff;
    padding: 5rem 0;
    text-align: center;
}

.cta-section h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.cta-section p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* Footer */
.site-footer {
    background: var(--color-dark);
    color: #fff;
    padding: 3rem 0 1rem;
}

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

.footer-col h4 {
    color: var(--color-secondary);
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

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

.footer-col ul li {
    margin-bottom: 0.5rem;
}

.footer-col a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-col a:hover {
    color: var(--color-secondary);
}

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

/* Contact Page */
.contact-section {
    padding: 5rem 0;
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
    background: var(--color-light);
    padding: 2rem;
    border-radius: 12px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--color-dark);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

/* Legal Pages */
.legal-page {
    padding: 5rem 0;
    max-width: 900px;
    margin: 0 auto;
}

.legal-page h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--color-primary);
}

.legal-page h2 {
    font-size: 1.75rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--color-dark);
}

.legal-page p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.legal-page ul {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.legal-page li {
    margin-bottom: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .main-nav {
        display: none;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .mobile-menu.active {
        display: flex;
    }

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

    .chinese-accent {
        font-size: 3rem;
    }

    .hero-subtitle {
        font-size: 1.25rem;
    }

    .ideogram-grid {
        grid-template-columns: 1fr;
    }

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

    .modal-content {
        grid-template-columns: 1fr;
        padding: 1.5rem;
    }

    .modal {
        padding: 1rem;
    }

    .modal-info h2 {
        font-size: 1.5rem;
    }

    .modal-info p {
        font-size: 1rem;
    }

    .modal-close {
        font-size: 2.5rem;
    }
}
