:root {
    --primary: #2d3142;
    --secondary: #ef8354;
    --accent: #4f5d75;
    --background: #f9fafc;
    --card-bg: rgba(255,255,255,0.7);
    --glass-blur: 12px;
    --border-radius: 20px;
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --navbar-bg: rgba(255,255,255,0.85);
    --navbar-blur: 10px;
    --navbar-link: #2d3142;
    --navbar-link-active: #ef8354;
    --navbar-link-hover: #4f5d75;
    --input-bg: rgba(255,255,255,0.8);
    --input-border: #e0e3eb;
    --input-focus: #ef8354;
    --button-bg: #ef8354;
    --button-hover: #4f5d75;
    --button-text: #fff;
    --transition: 0.25s cubic-bezier(.4,0,.2,1);
    --heading-font: 'Playfair Display', serif;
    --body-font: 'Inter', 'Roboto', Arial, sans-serif;
}

body {
    font-family: var(--body-font);
    background: linear-gradient(120deg, #f9fafc 0%, #e0e7ef 100%);
    color: var(--primary);
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fff;
    backdrop-filter: blur(var(--navbar-blur));
    box-shadow: 0 2px 8px 0 rgba(44,49,66,0.06);
    border-bottom: 1px solid #e0e3eb;
    transition: background var(--transition);
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand h1 {
    font-family: var(--heading-font);
    font-size: 2rem;
    color: var(--primary);
    margin: 0;
    letter-spacing: 1px;
}

.navbar-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.navbar-links a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 0.5rem 1.2rem;
    border-radius: 999px;
    transition: color var(--transition), background var(--transition);
    position: relative;
}

.navbar-links a.active-nav {
    color: var(--accent);
    background: #f3f4f8;
    box-shadow: none;
}

.navbar-links a:hover {
    color: var(--accent);
    background: #f3f4f8;
}

.main-header {
    background: linear-gradient(120deg, #f9fafc 0%, #e0e7ef 100%);
    padding: 3rem 1rem 2rem 1rem;
    text-align: center;
}

.main-header h1 {
    font-family: var(--heading-font);
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--primary);
    letter-spacing: 1px;
}

.subtitle {
    font-size: 1.3rem;
    color: var(--accent);
    margin: 0.2rem 0;
    font-weight: 500;
}

.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem 0 1rem;
    width: 100%;
}

.content-section {
    display: none;
    animation: fadeIn 0.5s cubic-bezier(.4,0,.2,1);
}

.content-section.active {
    display: block;
}

.search-container {
    margin-bottom: 2.5rem;
    display: flex;
    justify-content: center;
}

.search-input {
    width: 100%;
    max-width: 400px;
    padding: 1rem 1.2rem;
    font-size: 1.1rem;
    border: 2px solid var(--input-border);
    border-radius: 999px;
    background: var(--input-bg);
    transition: border var(--transition), box-shadow var(--transition);
    box-shadow: 0 2px 8px 0 rgba(31, 38, 135, 0.04);
}

.search-input:focus {
    outline: none;
    border-color: var(--input-focus);
    box-shadow: 0 4px 16px 0 rgba(239,131,84,0.10);
}

.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 2.5rem;
    padding: 1rem 0 2rem 0;
}

.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 2.2rem 2rem 1.5rem 2rem;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
    border: 1px solid #e0e3eb;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(var(--glass-blur));
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 16px 40px 0 rgba(31, 38, 135, 0.18);
    background: rgba(255,255,255,0.85);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e0e3eb;
}

.card-header h2 {
    font-family: var(--heading-font);
    color: var(--primary);
    font-size: 1.5rem;
    margin: 0;
    flex: 1;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.card-lang {
    font-size: 1rem;
    color: var(--accent);
    font-weight: 600;
    background: #f3f4f8;
    border-radius: 8px;
    padding: 0.2rem 0.7rem;
    margin-left: 1rem;
}

.card-lang-switch {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    background: transparent;
    box-shadow: none;
    gap: 0.3rem;
}

.lang-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 0.8rem 1.1rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
    transition: background var(--transition), color var(--transition), box-shadow var(--transition);
    border-radius: 999px;
    margin: 0;
    position: relative;
    min-width: 44px;
    min-height: 44px;
}

.lang-button.active .lang-flag {
    outline: 2.5px solid var(--accent);
    outline-offset: 2px;
    transform: scale(1.08);
}

.lang-button:hover .lang-flag {
    transform: scale(1.08) rotate(-2deg);
    outline: 2px solid #e0e3eb;
}

.card-content-lang {
    display: none;
}

.card-content-lang.active {
    display: block;
    animation: fadeInUp 0.5s cubic-bezier(.4,0,.2,1);
}

.card-section {
    margin-bottom: 1.5rem;
}

.card-section h3 {
    font-family: var(--heading-font);
    color: var(--secondary);
    font-size: 1.1rem;
    margin-bottom: 0.7rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px dashed #e0e3eb;
    font-weight: 700;
}

.card-section p {
    color: var(--primary);
    font-size: 1.05rem;
    line-height: 1.7;
}

.card-example {
    font-style: italic;
    background: linear-gradient(90deg, #f9fafc 0%, #e0e7ef 100%);
    border-left: 4px solid var(--secondary);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 0.8rem;
    color: var(--accent);
}

.card-remark {
    font-size: 0.98rem;
    color: #666;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #e0e3eb;
    background: rgba(239,131,84,0.04);
    border-radius: 0 0 16px 16px;
}

.about-content {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 2.5rem 2rem;
    margin-top: 1.5rem;
    backdrop-filter: blur(var(--glass-blur));
}

.about-content h2 {
    font-family: var(--heading-font);
    color: var(--primary);
    font-size: 2.1rem;
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 700;
}

.about-content p {
    margin-bottom: 1.1rem;
    font-size: 1.15rem;
    line-height: 1.8;
}

.main-footer {
    background: linear-gradient(90deg, #2d3142 0%, #4f5d75 100%);
    color: #fff;
    padding: 2.5rem 0 1.5rem 0;
    margin-top: 3rem;
    box-shadow: 0 -2px 16px 0 rgba(31, 38, 135, 0.07);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    text-align: center;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

@media (max-width: 900px) {
    .main-content {
        padding: 1.5rem 0.5rem 0 0.5rem;
    }
    .card-container {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 600px) {
    .navbar-container {
        flex-direction: column;
        gap: 0.7rem;
        padding: 1rem 0.5rem 1rem 0.5rem;
    }
    .navbar-links {
        gap: 0.7rem;
        width: 100%;
        justify-content: center;
    }
    .navbar-links a {
        font-size: 1.08rem;
        padding: 0.7rem 1.2rem;
        margin: 0.1rem 0;
        width: 100%;
        text-align: center;
        border-radius: 999px;
    }
    .main-header h1 {
        font-size: 1.3rem;
    }
    .subtitle {
        font-size: 0.98rem;
    }
    .main-content {
        padding: 1.2rem 0.5rem 0 0.5rem;
        box-sizing: border-box;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }
    .card-container {
        grid-template-columns: 1fr;
        gap: 1.2rem;
        padding: 0.5rem 0.2rem 1rem 0.2rem;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
        justify-items: center;
    }
    .card {
        padding: 1rem 1rem 0.8rem 1rem;
        box-sizing: border-box;
        width: 100%;
        max-width: 370px;
        margin: 0 auto;
        font-size: 0.97rem;
        border-radius: 18px;
        box-shadow: 0 2px 12px 0 rgba(44,49,66,0.07);
        background: var(--card-bg);
    }
    .card-header h2 {
        font-size: 1.25rem;
        font-weight: 700;
        letter-spacing: 0.5px;
        margin-bottom: 0.2rem;
    }
    .card-header {
        margin-bottom: 1rem;
        padding-bottom: 0.6rem;
    }
    .card-section h3 {
        font-size: 0.98rem;
        margin-bottom: 0.4rem;
        padding-bottom: 0.2rem;
    }
    .card-section p, .card-remark {
        font-size: 0.97rem;
    }
    .card-example {
        font-size: 0.96rem;
        padding: 0.7rem;
    }
    .lang-flag {
        width: 22px;
        height: 16px;
    }
    .about-content {
        padding: 1.2rem 0.5rem;
    }
    .about-content h2 {
        font-size: 1.1rem;
    }
    .about-content p {
        font-size: 0.98rem;
    }
    body, html {
        overflow-x: hidden !important;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.lang-flag {
    width: 28px;
    height: 20px;
    object-fit: cover;
    border-radius: 6px;
    box-shadow: 0 1px 4px 0 rgba(44,49,66,0.10);
    display: block;
    margin: 0;
    transition: transform 0.18s cubic-bezier(.4,0,.2,1), outline 0.18s cubic-bezier(.4,0,.2,1);
}