/* General Styling */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: #001F54;
    color: white;
    padding: 20px;
    display: flex;
    align-items: flex-end; /* 改为底部对齐 */
    z-index: 10;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.header .logo {
    display: flex;
    align-items: flex-end; /* 与头部底部对齐 */
    margin-right: 20px; /* 添加一点右边距，与公司名称分开 */
}

.header .logo img {
    width: 60px;
    height: auto;
    margin-right: 10px;
}

.header .company-name {
    font-size: 40px;
    font-weight: bold;
    flex: 1;
    text-align: center;
    padding-bottom: 5px; /* 微调文字底部位置 */
}

.header .nav {
    display: flex;
    margin-left: auto; /* 将导航栏推到最右侧 */
}

.header .nav a {
    color: white;
    margin: 0 10px;
    text-decoration: none;
    font-size: 18px;
    display: block;
    padding-bottom: 5px; /* 保持文本底部对齐 */
}

.header .cta-button {
    background-color: #00BFFF;
    color: white;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    margin-left: 20px; /* 在按钮和导航之间添加间距 */
    align-self: flex-end; /* 按钮也底部对齐 */
}

/* General Section Styling */
section {
    margin: 0 20px;
    /* Adds margin to the left and right of each section */
    padding: 20px;
    background-color: white;
    box-sizing: border-box;
    scroll-margin-top: 120px; /* 添加此行以解决锚点跳转时被header遮挡的问题 */
}

/* 为所有带ID的section添加偏移量，以便考虑固定头部的高度 */
section[id] {
    scroll-margin-top: 120px; /* 调整此值以匹配header的高度 */
}

/* Content within each section */
section>.content {
    margin-left: 300px;
    margin-right: 300px;
}

/* Hero Section */
.hero {
    position: relative;
    background-image: url('pic/background.jpeg');
    background-size: cover;
    color: white;
    text-align: center;
    padding: 230px 20px;
    overflow: hidden;
}

.hero canvas#atomCanvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 1;
}

.hero h1, .hero p {
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: 50px;
}

.hero p {
    font-size: 20px;
    margin-top: 10px;
}

/* Highlights Section */
.highlights {
    display: flex;
    justify-content: space-around;
    padding: 50px 20px;
    background-color: #000000; /* 保持黑色背景 */
}

.highlight-box {
    background-color: #001F54; /* 改为深蓝色，与品牌色一致 */
    width: 30%;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    text-align: center;
    border-radius: 8px;
    color: white; /* 文字设为白色 */
}

.highlight-box .icon {
    font-size: 40px;
    color: #00BFFF; /* 图标使用品牌蓝色 */
}

.highlight-box h3 {
    font-size: 24px;
    margin-top: 10px;
}

/* About Us Section */
.about-section {
    background-color: #ffffff;
    min-height: 700px; /* 改为最小高度而不是固定高度 */
    padding: 50px 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    box-sizing: border-box;
}

.about-container {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-top: 30px;
    margin-bottom: 60px; /* 增加底部边距 */
    flex: 1; 
    min-height: 0;
}

.about-text {
    width: 60%;
    margin-right: 20px;
    margin-left: 100px;
    margin-top: 30px;
    padding-bottom: 40px; /* 增加底部内边距 */
}

.about-text h2 {
    font-size: 36px;
    font-weight: bold;
    color: #001F54;
    margin-bottom: 20px;
}

.about-text p,
.about-text ul {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    margin-bottom: 10px;
}

.about-text ul {
    list-style-type: disc;
    padding-left: 20px;
}

.about-image {
    width: 30%;
    margin-top: 30px;
    margin-bottom: 40px; /* 增加底部边距 */
    display: flex;
    justify-content: center;
    align-items: flex-start;
    flex-shrink: 0;
}

.about-image img {
    width: 40%;
    height: auto;
    margin-top: 200px;
    margin-right: 100px;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Products Section */
section#products {
    height: auto;
    background-color: #e9f7f8; /* Light cyan background color (different from About Us) */
    padding: 50px 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* Section Title (highlighted at left-top) */
.products .section-title {
    margin-left: 100px; /* Left margin */
}

.products .section-title h2 {
    font-size: 36px;
    font-weight: bold;
    color: #001F54; /* Dark blue for section name */
    margin-bottom: 30px;
}

/* Product Grid Styling */
.product-grid {
    display: flex;
    justify-content: space-between;
    margin: 0 100px;
}

.product-card {
    width: 30%;
    background-color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 0;
    text-align: center;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 468px;
}

.product-card h3 {
    font-size: 24px;
    margin: 15px 20px 10px 20px;
}

.product-card p {
    font-size: 16px;
    margin: 0 20px 20px 20px;
    flex-grow: 1;
}

.product-card .cta-button {
    background-color: #00BFFF; /* Light blue */
    color: white;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    text-align: center;
    border: none;
    border-radius: 4px;
    margin: 0 20px 20px 20px;
    align-self: center;
    width: calc((100% - 40px) * 2/3);
    display: block;
    text-decoration: none;
}

.product-card .cta-button:hover {
    background-color: #0099cc; /* Hover effect */
}

/* Contact Us Section */
section#contact {
    height: 700px;
    background-color: #f1f1f1; /* Light gray background color (different from About Us) */
    padding: 50px 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* Section Title (highlighted at top-left) */
.contact .section-title {
    margin-left: 100px; /* Left margin for section title */
}

.contact .section-title h2 {
    font-size: 36px;
    font-weight: bold;
    color: #001F54; /* Dark blue for section name */
    margin-bottom: 30px;
}

/* Contact Form and Contact Info Layout */
.contact-content {
    display: flex;
    justify-content: flex-start;
    gap: 20px;
    margin-left: 100px;
    margin-right: 100px;
    height: 350px;
}

.contact-map {
    width: 55%;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#amap {
    width: 100% !important;
    height: 100% !important;
}

/* Social Media Image Placeholders */
.contact-info-map .social-media {
    display: flex;
    justify-content: flex-start;
    gap: 20px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.social-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.social-item p {
    margin-top: 10px;
    margin-bottom: 0;
    font-size: 14px;
    color: #333;
}

.contact-info-map .social-icon {
    width: 169px;
    height: auto;
    max-width: 338px;
    max-height: 338px;
    object-fit: cover;
}

/* Contact Info Map Layout */
.contact-info-map {
    width: 30%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    flex-shrink: 0;
}

.contact-info p {
    font-size: 16px;
}

.contact-info a {
    color: #00BFFF;
    text-decoration: none;
}

.contact-info a:hover {
    color: #0099cc;
}

/* Footer */
footer {
    background-color: #001F54;
    color: white;
    padding: 20px;
    text-align: center;
}

footer ul {
    list-style-type: none;
    padding: 0;
}

footer ul li {
    display: inline;
    margin: 0 10px;
}

footer ul li a {
    color: white;
    text-decoration: none;
}

footer ul li a:hover {
    color: #0099cc;
}

footer p {
    margin: 4px 0;
    font-size: 13px;
}

footer p a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
}

footer p a:hover {
    color: #00BFFF;
}

/* Product Image Styling */
.product-image {
    width: calc(100% - 40px);
    height: 270px;
    object-fit: contain;
    object-position: center;
    background-color: #f9f9f9;
    display: block;
    margin: 20px 20px 0 20px;
    border-radius: 4px;
}

/* Modal Styling */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 30px;
    border: 1px solid #888;
    border-radius: 8px;
    width: 80%;
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.modal-content h2 {
    color: #001F54;
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 28px;
}

.modal-content h3 {
    color: #001F54;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 18px;
}

.modal-body {
    line-height: 1.8;
    color: #333;
}

.modal-body p {
    margin: 10px 0;
    font-size: 15px;
}

.modal-body ul {
    margin: 10px 0;
}

.modal-body li {
    margin: 5px 0;
    font-size: 15px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.close:hover,
.close:focus {
    color: #001F54;
}

/* =====================
   移动端响应式适配
   ===================== */

/* 平板（768px - 1024px） */
@media screen and (max-width: 1024px) {
    .header {
        padding: 15px 20px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .header .company-name {
        font-size: 28px;
    }

    .hero {
        padding: 160px 20px;
    }

    .hero h1 {
        font-size: 36px;
    }

    .about-container {
        flex-direction: column;
    }

    .about-text {
        width: 100%;
        margin: 0;
        padding: 0 20px;
    }

    .about-image {
        width: 100%;
        margin-top: 20px;
    }

    .about-image img {
        margin: 0 auto;
        display: block;
    }

    .product-grid {
        flex-direction: column;
        gap: 20px;
        margin: 0 20px;
    }

    .product-card {
        width: 100%;
        min-height: auto;
    }

    .contact-content {
        flex-direction: column;
        height: auto;
    }

    .contact-map {
        width: 100%;
        height: 300px;
        order: -1;
    }

    .contact-info-map {
        width: 100%;
    }

    .contact .section-title,
    .products .section-title {
        margin-left: 20px;
    }
}

/* 手机（最大 768px） */
@media screen and (max-width: 768px) {
    /* Header */
    .header {
        flex-direction: column;
        align-items: center;
        padding: 12px 16px;
        gap: 10px;
    }

    .header .logo {
        margin-right: 0;
        align-items: center;
    }

    .header .logo img {
        width: 45px;
    }

    .header .company-name {
        font-size: 22px;
        text-align: center;
    }

    .header .nav {
        margin-left: 0;
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px;
    }

    .header .nav a {
        font-size: 14px;
        margin: 0 6px;
        padding-bottom: 2px;
    }

    .header .cta-button {
        margin-left: 0;
        font-size: 13px;
        padding: 8px 16px;
    }

    /* Hero */
    .hero {
        padding: 355px 16px 80px;
    }

    .hero h1 {
        font-size: 26px;
        line-height: 1.3;
    }

    .hero p {
        font-size: 15px;
        margin-top: 12px;
    }

    /* Sections common */
    section {
        margin: 0;
        padding: 355px 16px 40px;
        scroll-margin-top: 340px;
    }

    section[id] {
        scroll-margin-top: 340px;
    }

    /* Highlights */
    .highlights {
        flex-direction: column;
        gap: 16px;
        padding: 40px 16px;
    }

    .highlight-box {
        width: 100%;
    }

    .highlight-box h3 {
        font-size: 20px;
    }

    /* About */
    .about-section {
        padding: 40px 16px;
        min-height: auto;
    }

    .about-text {
        padding: 0;
    }

    .about-text h2 {
        font-size: 28px;
    }

    .about-text p,
    .about-text ul li {
        font-size: 15px;
    }

    .about-image {
        display: none;
    }

    /* Products */
    .products {
        padding: 40px 16px;
        min-height: auto;
    }

    .products .section-title {
        margin-left: 0;
    }

    .products .section-title h2 {
        font-size: 28px;
        margin-bottom: 20px;
    }

    .product-grid {
        margin: 0;
        gap: 16px;
    }

    .product-card {
        width: 100%;
        min-height: auto;
    }

    .product-card h3 {
        font-size: 20px;
    }

    .product-image {
        height: 200px;
    }

    .product-card .cta-button {
        width: calc(100% - 40px);
    }

    /* Contact */
    .contact {
        padding: 40px 16px 120px;
        min-height: auto;
        /* overflow: hidden; */
    }

    .contact .section-title {
        margin-left: 0;
    }

    .contact .section-title h2 {
        font-size: 28px;
    }

    .contact-content {
        margin: 0;
        gap: 20px;
    }

    .contact-map {
        height: 250px;
    }

    .contact-info-map {
        gap: 0;
    }

    .social-media {
        gap: 12px;
    }

    .contact-info-map .social-icon {
        width: 130px;
    }

    /* Footer */
    footer {
        padding: 16px;
        font-size: 13px;
        margin-top: 40px;
    }

    footer ul li {
        display: block;
        margin: 6px 0;
    }

    /* Modal */
    .modal-content {
        width: 92%;
        padding: 20px 16px;
        margin: 10% auto;
        max-height: 85vh;
    }

    .modal-content h2 {
        font-size: 22px;
    }

    .modal-content h3 {
        font-size: 16px;
    }

    .modal-body p,
    .modal-body li {
        font-size: 14px;
    }
}

/* 超小屏（最大 480px） */
@media screen and (max-width: 480px) {
    .header .company-name {
        font-size: 18px;
    }

    .header .logo img {
        width: 38px;
    }

    .hero h1 {
        font-size: 22px;
    }

    .highlight-box {
        padding: 16px;
    }

    .about-text h2 {
        font-size: 24px;
    }

    .product-image {
        height: 180px;
    }

    .contact-info-map .social-icon {
        width: 110px;
    }
}

/* ====================================
   第一阶段动效：Hero 文字淡入
   ==================================== */
.hero h1,
.hero p {
    opacity: 0;
    animation: heroFadeIn 0.8s ease-out forwards;
}
.hero h1 { animation-delay: 0.3s; }
.hero p  { animation-delay: 0.9s; }

@keyframes heroFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ====================================
   第一阶段动效：产品卡片悬停
   ==================================== */
.product-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.product-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 12px 24px rgba(0, 31, 84, 0.18);
}
.product-card .cta-button {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s ease, background-color 0.2s;
}
.product-card:hover .cta-button {
    opacity: 1;
    transform: translateY(0);
}

/* ====================================
   第一阶段动效：滚动淡入
   ==================================== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}
}
/* Language Switch Button */
.lang-switch {
    margin-left: 24px;
    flex-shrink: 0;
}
.lang-switch a {
    display: inline-block;
    padding: 5px 14px;
    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 20px;
    color: rgba(255,255,255,0.8);
    font-size: 0.8rem;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.05em;
    text-decoration: none;
    transition: all 0.3s ease;
}
.lang-switch a:hover {
    border-color: rgba(0,191,255,0.8);
    color: #00BFFF;
    background: rgba(0,191,255,0.08);
    box-shadow: 0 0 12px rgba(0,191,255,0.3);
}

@media (max-width: 768px) {
    .lang-switch {
        margin-left: 0;
        margin-top: 8px;
    }
}
