html {
    scroll-behavior: smooth;
}

:root {
    /* Brand Colors extracted from Logo */
    --color-primary: #0052cc;
    --color-secondary: #00c2ff;
    --color-accent: #00e5ff;
    --color-dark: #0a192f;
    --color-text: #333333;
    --color-text-light: #666666;
    --color-white: #ffffff;
    --color-bg-light: #f4f7fa;
    --color-border: #e1e8ed;
    --color-danger: #dc2626;
    
    /* Typography */
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-heading: 'Outfit', sans-serif;

    /* Spacing */
    --section-padding: 80px 0;
    --container-width: 1320px;
    --border-radius: 8px;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.15);
    
    /* Transitions */
    --transition: all 0.3s ease;
}

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

body {
    font-family: var(--font-main);
    color: var(--color-text);
    line-height: 1.6;
    background-color: var(--color-white);
    overflow-x: hidden;
    overflow-y: scroll;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* Icon Sizing for consistency */
.icon-wrapper {
    display: inline-block;
    width: 1.5em;
    height: 1.5em;
    text-align: center;
    line-height: 1.5em;
    font-size: 1.2rem;
    vertical-align: middle;
}

/* Typography Utilities */
h1 {
    font-size: 3.8rem;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--color-dark);
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
}

.section-title h2 {
    font-size: 2.5rem;
    position: relative;
    padding-bottom: 15px;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(to right, var(--color-primary), var(--color-secondary));
    border-radius: 2px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    border: none;
    transition: var(--transition);
}

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

.btn-primary:hover {
    background-color: var(--color-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
}

.btn-outline:hover {
    background: var(--color-primary);
    color: white;
}

/* Navigation Header */
.header {
    height: 80px;
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: 1560px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo img {
    height: 44px;
    width: auto;
}

.nav-links {
    display: flex;
    gap: 15px;
    height: 80px;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links > li {
    position: relative;
    height: 80px; /* Force consistent trigger area */
    display: flex;
    align-items: center;
}

.nav-links a {
    font-weight: 500;
    font-size: 0.9rem;
    white-space: nowrap;
    padding: 10px 5px;
    transition: var(--transition);
}

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

/* Dropdown Menu */
.dropdown {
    position: absolute;
    top: 100%; /* Align to bottom of header */
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-white);
    min-width: 180px;
    padding: 10px 0;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    display: none; /* Reliable trigger */
    z-index: 9999;
    border: 1px solid #f1f5f9;
}

.nav-links > li:hover .dropdown {
    display: block;
}

.dropdown li a {
    display: block;
    padding: 10px 25px;
    color: var(--color-text);
    font-size: 0.9rem;
    font-weight: 400;
    transition: background 0.2s, color 0.2s;
}

.dropdown li a:hover {
    background: #f8fafc;
    color: var(--color-primary);
}

.dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 12px;
    height: 12px;
    background: var(--color-white);
    border-top: 1px solid #f1f5f9;
    border-left: 1px solid #f1f5f9;
}

/* Header Actions (Search + Language) */
.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Search */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box input {
    width: 0;
    padding: 0;
    border: 1px solid var(--color-border);
    border-radius: 20px;
    outline: none;
    font-size: 0.9rem;
    font-family: var(--font-main);
    transition: var(--transition);
    background: transparent;
    cursor: pointer;
}

.search-box input.expanded {
    width: 150px;
    padding: 6px 32px 6px 12px;
    background: var(--color-white);
    cursor: text;
}

.search-box input.expanded:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 82, 204, 0.1);
}

.search-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 8px;
    font-size: 1.1rem;
    color: var(--color-text-light);
    transition: var(--transition);
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover {
    color: var(--color-primary);
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 2px;
    background: var(--color-bg-light);
    border-radius: 20px;
    padding: 2px;
}

.lang-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 10px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font-main);
    border-radius: 18px;
    color: var(--color-text-light);
    transition: var(--transition);
}

.lang-btn.active {
    background: var(--color-primary);
    color: white;
}

.lang-btn:hover:not(.active) {
    color: var(--color-primary);
}

/* Search Results Dropdown */
.search-results {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    max-height: 400px;
    overflow-y: auto;
    background: var(--color-white);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-border);
    display: none;
    z-index: 1001;
}

.search-results.show {
    display: block;
}

.search-results-item {
    display: block;
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border);
    transition: var(--transition);
    cursor: pointer;
}

.search-results-item:last-child {
    border-bottom: none;
}

.search-results-item:hover {
    background: var(--color-bg-light);
}

.search-results-item .result-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-dark);
    margin-bottom: 2px;
}

.search-results-item .result-desc {
    font-size: 0.8rem;
    color: var(--color-text-light);
}

.search-results-empty {
    padding: 20px;
    text-align: center;
    color: var(--color-text-light);
    font-size: 0.9rem;
}

/* Tablet responsive */
@media (max-width: 1024px) {
    .nav-links {
        gap: 14px;
    }

    .nav-links a {
        font-size: 0.85rem;
    }

    .search-box input.expanded {
        width: 130px;
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .header-actions {
        gap: 6px;
    }

    .nav-links {
        gap: 10px;
    }

    .nav-links a {
        font-size: 0.8rem;
    }

    .search-box input.expanded {
        width: 100px;
        padding: 5px 28px 5px 10px;
    }

    .search-results {
        width: 260px;
        right: -40px;
    }

    .lang-btn {
        padding: 3px 6px;
        font-size: 0.7rem;
    }

    .logo img {
        height: 36px;
    }
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, rgba(10,25,47,0.9), rgba(0,82,204,0.7)), url('../images/hero-bg.jpg');
    background-size: cover;
    background-position: center;
    color: white;
    padding-top: 80px;
}

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

.hero-content h1 {
    font-size: 4.5rem;
    color: white;
    margin-bottom: 20px;
}

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

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

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.footer-logo img {
    height: 120px;
    margin-bottom: 10px;
}

.footer-title {
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: var(--color-secondary);
}

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

.footer-links a:hover {
    color: var(--color-secondary);
    padding-left: 5px;
}

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

/* Footer Social Icons - Vertical Side Layout */
.footer-logo-wrapper {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
}

.footer-social {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.social-item {
    position: relative;
    cursor: pointer;
}

.social-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    background: rgba(255,255,255,0.08);
    padding: 0;
    line-height: 0;
}

.social-icon img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    display: block;
    margin: 0;
}

.social-item:hover .social-icon {
    background: white;
    transform: scale(1.1);
    border-color: white;
}

.qr-popup {
    position: absolute;
    left: 45px;
    top: 50%;
    transform: translateY(-50%) translateX(10px);
    background: white;
    padding: 8px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    width: 120px;
    height: 120px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
}

.qr-popup::after {
    content: '';
    position: absolute;
    left: -6px;
    top: 50%;
    transform: translateY(-50%);
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 6px solid white;
}

.social-item:hover .qr-popup {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

.qr-popup img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Quill Rich Text Rendering Support */
.body-text .ql-font-microsoftyahei { font-family: "Microsoft YaHei", "微软雅黑", sans-serif; }
.body-text .ql-font-simsun { font-family: "SimSun", "宋体", serif; }
.body-text .ql-font-kaiti { font-family: "KaiTi", "楷体", serif; }
.body-text .ql-font-simhei { font-family: "SimHei", "黑体", sans-serif; }

.body-text .ql-size-12px { font-size: 12px; }
.body-text .ql-size-14px { font-size: 14px; }
.body-text .ql-size-18px { font-size: 18px; }
.body-text .ql-size-20px { font-size: 20px; }
.body-text .ql-size-24px { font-size: 24px; }
.body-text .ql-size-32px { font-size: 32px; }

.body-text .ql-align-center { text-align: center; }
.body-text .ql-align-right { text-align: right; }
.body-text .ql-align-justify { text-align: justify; }

.body-text img {
    max-width: 100%;
    height: auto;
    display: inline-block; /* Support parent text-align */
    margin: 10px 0;
}

.body-text .ql-align-center img {
    display: block;
    margin: 10px auto;
}

.body-text .ql-indent-2em {
    text-indent: 2em;
}

.body-text blockquote {
    border-left: 4px solid #ccc;
    margin-bottom: 5px;
    margin-top: 5px;
    padding-left: 16px;
}

.body-text pre {
    background-color: #23241f;
    color: #f8f8f2;
    overflow: visible;
    border-radius: 3px;
    padding: 5px 10px;
}

/* --- English Version Specific Adjustments --- */
html[lang="en"] .nav-links {
    gap: 8px;
}
html[lang="en"] .nav-links a {
    font-size: 0.82rem;
    padding: 10px 2px;
}
html[lang="en"] .header-actions {
    gap: 5px;
}
html[lang="en"] .btn {
    padding: 10px 18px;
    font-size: 0.85rem;
}

/* --- Card Link Interactive Style --- */
.card-link {
    display: block;
    background: var(--color-white);
    padding: 40px;
    text-align: center;
    box-shadow: var(--shadow-md);
    border-radius: 15px;
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.card-link:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(0, 82, 204, 0.15);
}

.card-link h3 {
    transition: var(--transition);
}

.card-link:hover h3 {
    color: var(--color-primary);
}


