/* 基础样式（PC端基准，1280x720） */
html {
    font-size: 16px;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: 'Noto Sans SC', 'Noto Sans JP', 'Roboto', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f8f8;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* 头部 */
.header {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.2));
    color: white;
    padding: 40px 20px 20px;
    text-align: center;
    position: relative;
    z-index: 1;
    animation: fadeIn 1.2s ease-in;
}
.header .logo-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
    margin-top: -20px;
}
.header img {
    height: 267.75px;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 导航栏 */
.nav {
    background-color: #1a1a1a;
    padding: 15px 20px;
    text-align: center;
    position: relative;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: center;
    overflow-x: auto;
    white-space: nowrap;
    margin-top: -30px;
}
.nav a {
    color: white;
    margin: 0 25px;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    padding: 12px 20px;
    transition: all 0.3s ease;
    display: inline-block;
}
.nav a:hover {
    color: #ff4d4d;
    border-bottom: 3px solid #ff4d4d;
}

/* 语言切换 */
.lang-switch {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 11;
}
.lang-switch a {
    color: white;
    text-decoration: none;
    font-size: 1rem;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    margin-left: 10px;
}
.lang-switch a:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* 视频背景 */
.video-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}
.video-background video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.video-background .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 0;
}
.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.8);
    color: #333;
    border: none;
    padding: 15px 30px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.2rem;
    z-index: 1;
    display: none;
}
.play-button:hover {
    background: rgba(255, 255, 255, 1);
}

/* 内容区域（PC端基准） */
.container {
    max-width: 1280px;
    margin: 60px auto;
    padding: 0 15px;
    position: relative;
    z-index: 1;
    flex: 1;
}
.container h2 {
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 2.5rem; /* 40px */
    margin-bottom: 30px;
    text-align: center;
    color: #fff;
}
.container .welcome-title {
    color: #fff;
}
.container p {
    font-size: 1.1rem; /* 17.6px */
    color: #fff;
    max-width: 800px;
    margin: 0 auto 20px;
    text-align: center;
}

/* 搜索栏 */
.search-bar {
    margin-bottom: 15px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}
.search-bar input[type="text"],
.search-bar button {
    padding: 8px 15px;
    height: 36px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    box-sizing: border-box;
    outline: none;
    vertical-align: middle;
}
.search-bar input[type="text"] {
    width: 200px;
    border: 1px solid #ddd;
}
.search-bar button {
    width: 100px;
    background-color: #ff4d4d;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.search-bar button:hover {
    background-color: #e63939;
}

/* 分类栏 */
.category-bar {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.category-bar a {
    color: #fff;
    text-decoration: none;
    font-size: 1.1rem;
    padding: 8px 15px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}
.category-bar a:hover, .category-bar a.active {
    background-color: #ff4d4d;
}

/* 产品网格 */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 20px;
    max-width: 100%;
}
.product-item {
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    text-align: center;
    transition: transform 0.3s ease;
}
.product-item:hover {
    transform: scale(1.02);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.product-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 10px;
}
.product-item h3 {
    font-size: 1.1rem;
    color: #333;
    margin: 0 0 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.product-item .price {
    font-size: 1.2rem;
    color: #ff4d4d;
    font-weight: bold;
    margin: 5px 0;
}
.product-item p {
    font-size: 0.9rem;
    color: #666;
    margin: 5px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.cta-button {
    background-color: #ff4d4d;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
    display: inline-block;
    margin-top: 10px;
}
.cta-button:hover {
    background-color: #e63939;
}

/* 时间轴 */
.timeline-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 20px;
}
.timeline-item {
    background: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.timeline-item h3 {
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: #ff4d4d;
    margin-bottom: 10px;
}
.timeline-item p {
    font-size: 1.1rem;
    color: #333;
    line-height: 1.6;
}

/* 动态资讯网格 */
.news-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 20px;
}
.news-item {
    background: white;
    border-radius: 10px;
    padding: 20px; /* 增加内边距以填充空白区域 */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.news-item h3 {
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: #ff4d4d;
    margin-bottom: 10px;
}
.news-item .news-date {
    text-align: left !important; /* 确保日期左对齐 */
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 10px;
}
.news-item p {
    text-align: left !important; /* 左对齐，覆盖居中样式 */
    max-width: none !important; /* 移除宽度限制，让文本占满整行 */
    margin: 0 0 10px; /* 调整外边距 */
    color: #333 !important; /* 确保颜色与背景对比 */
    line-height: 1.6; /* 保持行间距 */
    white-space: normal; /* 确保自动换行 */
}
.news-images {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}
.news-images img {
    max-width: 100%;
    width: 150px;
    height: auto;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.3s ease;
}
.news-images img:hover {
    transform: scale(1.05);
}

/* 图片放大模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
}
.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
}
.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
}
.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* 页脚 */
.footer {
    background-color: #1a1a1a;
    color: white;
    padding: 30px 15px;
    text-align: center;
    width: 100%;
}
.footer-content {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}
.footer-content p {
    font-size: 0.95rem;
    font-weight: 400;
    margin: 0;
    color: white;
}
.footer-content .contact-info {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

/* 地图 */
#world-map, #country-map {
    width: 95vw;
    max-width: 1500px;
    height: 500px;
    margin: -20px auto 20px;
    position: relative;
    z-index: 1;
}
.country-select {
    margin: 10px 0;
    text-align: center;
}
.country-select select {
    padding: 10px;
    font-size: 1.1rem;
    border-radius: 5px;
}

/* 产品详情页面样式 */
.product-detail {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.product-detail-left {
    flex: 1;
    min-width: 300px;
}
.product-detail-left .main-image {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    max-height: 600px;
    min-height: 200px;
}
.product-detail-right {
    flex: 2;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.product-detail-right .sub-images {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: space-between;
    width: 100%;
}
.product-detail-right .sub-images img {
    width: calc(33.33% - 7px);
    height: auto;
    aspect-ratio: 1 / 1;
    max-width: 300px;
    min-width: 100px;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.product-detail-right .sub-images img:hover {
    transform: scale(1.05);
}
.product-detail-right p {
    font-size: 1.1rem;
    color: #333;
    line-height: 1.6;
    text-align: left;
    margin-top: auto;
}

/* AI聊天窗口 */
.ai-chat-container {
    max-width: 800px;
    margin: 40px auto;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}
.ai-chat-header {
    background: #ff4d4d;
    color: white;
    padding: 15px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.ai-chat-header .lang-switch {
    position: static;
    display: flex;
    gap: 10px;
}
.ai-chat-header .lang-switch a {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 10px;
    border-radius: 5px;
    color: white;
    font-size: 0.9rem;
}
.ai-chat-header .lang-switch a:hover {
    background: rgba(255, 255, 255, 0.4);
}
.ai-chat-body {
    background: #f8f8f8;
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
    border-bottom: 1px solid #ddd;
}
.ai-message, .user-message {
    margin-bottom: 15px;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 1rem;
}
.ai-message {
    background: #fff;
    text-align: left;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}
/* 新增子选择器强制覆盖 */
.ai-message p {
    color: #333 !important; /* 强制指定段落颜色 */
}
.user-message {
    background: #ff4d4d;
    color: white; /* 用户消息保持白色，与红色背景对比 */
    text-align: right;
}
.ai-chat-input {
    background: #fff;
    padding: 20px;
}
.ai-chat-input form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.ai-chat-input textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    resize: vertical;
    color: #333; /* 输入框字体颜色设置为深灰色 */
    background: #fff; /* 确保背景为白色 */
}
.ai-chat-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.ai-chat-buttons input[type="file"] {
    font-size: 0.9rem;
    color: #333; /* 文件输入字体颜色设置为深灰色 */
}
.ai-chat-buttons button {
    background: #ff4d4d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.3s ease;
}
.ai-chat-buttons button:hover {
    background: #e63939;
}

/* 媒体查询 - 平板设备 */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    .header {
        padding: 30px 15px 15px;
    }
    .header .logo-title {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 5px;
        margin-top: -15px;
    }
    .header img {
        height: 180px;
        margin-top: 10px;
    }
    .nav {
        margin-top: -10px;
        padding: 10px 15px;
    }
    .nav a {
        margin: 0 10px;
        font-size: 0.95rem;
        padding: 8px 12px;
    }
    .lang-switch {
        top: 10px;
        right: 10px;
    }
    .lang-switch a {
        font-size: 0.9rem;
        padding: 4px 8px;
    }
    .container {
        margin: 40px auto;
        padding: 0 15px;
    }
    .container h2 {
        font-size: 1.8rem;
        margin-bottom: 20px;
    }
    .container p {
        font-size: 1rem;
    }
    .search-bar {
        margin-bottom: 12px;
        gap: 10px;
    }
    .search-bar input[type="text"], .search-bar button {
        padding: 6px 12px;
        height: 32px;
        font-size: 0.9rem;
    }
    .search-bar input[type="text"] {
        width: 180px;
    }
    .search-bar button {
        width: 90px;
    }
    .category-bar {
        gap: 15px;
    }
    .category-bar a {
        font-size: 0.9rem;
        padding: 6px 12px;
    }
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    .product-item {
        padding: 8px;
    }
    .product-item img {
        height: 150px;
        border-radius: 4px;
    }
    .product-item h3 {
        font-size: 1rem;
    }
    .product-item .price {
        font-size: 1.1rem;
    }
    .product-item p {
        font-size: 0.8rem;
    }
    .cta-button {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    .timeline-item h3 {
        font-size: 1.3rem;
    }
    .timeline-item p {
        font-size: 1rem;
    }
    .news-item h3 {
        font-size: 1.3rem;
    }
    .news-item .news-date {
        font-size: 0.85rem;
    }
    .news-item p {
        font-size: 1rem;
    }
    .news-images img {
        width: 120px;
    }
    .footer {
        padding: 20px 15px;
    }
    .footer-content {
        gap: 12px;
    }
    .footer-content p {
        font-size: 0.9rem;
    }
    .footer-content .contact-info {
        gap: 15px;
    }
    #world-map, #country-map {
        height: 400px;
        width: 90vw;
        margin-top: -40px;
    }
    .product-detail {
        flex-direction: column;
        padding: 15px;
    }
    .product-detail-left .main-image {
        width: 100%;
        height: auto;
        object-fit: contain;
        border-radius: 5px;
        cursor: pointer;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        max-height: 500px;
        min-height: 200px;
    }
    .product-detail-right .sub-images {
        gap: 8px;
    }
    .product-detail-right .sub-images img {
        width: calc(33.33% - 6px);
        max-width: 250px;
        min-width: 80px;
    }
    .ai-chat-container {
        margin: 15px;
    }
    .ai-chat-header h3 {
        font-size: 1rem;
    }
    .ai-chat-input textarea {
        height: 50px;
        font-size: 0.9rem;
    }
    .ai-chat-buttons button {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
}

/* 媒体查询 - 手机设备（竖屏） */
@media (max-width: 480px) {
    html {
        font-size: 12px;
    }
    .header {
        padding: 25px 10px 10px;
    }
    .header img {
        height: 135px;
        margin-top: 8px;
    }
    .nav {
        padding: 8px 10px;
    }
    .nav a {
        margin: 0 8px;
        font-size: 0.9rem;
        padding: 6px 10px;
    }
    .lang-switch a {
        font-size: 0.85rem;
        padding: 3px 6px;
    }
    .container {
        margin: 30px auto;
        padding: 0 10px;
    }
    .container h2.welcome-title {
        font-size: 2rem !important;
    }
    .container p {
        font-size: 1.3rem !important;
    }
    .search-bar input[type="text"] {
        width: 150px;
    }
    .search-bar button {
        width: 80px;
    }
    .category-bar {
        gap: 10px;
    }
    .category-bar a {
        font-size: 0.85rem;
        padding: 5px 10px;
    }
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .product-item {
        padding: 5px;
        border: 1px solid #ddd;
    }
    .product-item img {
        height: 120px;
        border-radius: 3px;
    }
    .product-item h3 {
        font-size: 0.9rem;
        margin: 0 0 5px;
    }
    .product-item .price {
        font-size: 1rem;
        margin: 3px 0;
    }
    .product-item p {
        font-size: 0.7rem;
        -webkit-line-clamp: 1;
    }
    .cta-button {
        padding: 5px 10px;
        font-size: 0.7rem;
        margin-top: 5px;
    }
    .timeline-item h3 {
        font-size: 1.1rem;
    }
    .timeline-item p {
        font-size: 0.9rem;
    }
    .news-item h3 {
        font-size: 1.1rem;
    }
    .news-item .news-date {
        font-size: 0.8rem;
    }
    .news-item p {
        font-size: 0.9rem;
    }
    .news-images img {
        width: 100px;
    }
    .footer-content p {
        font-size: 0.85rem;
    }
    .footer-content .contact-info {
        gap: 10px;
    }
    #world-map, #country-map {
        height: 300px;
        width: 100vw;
        margin: -20px auto 10px;
    }
    .product-detail {
        padding: 10px;
    }
    .product-detail-left .main-image {
        width: 100%;
        height: auto;
        object-fit: contain;
        border-radius: 5px;
        cursor: pointer;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        max-height: 400px;
        min-height: 150px;
    }
    .product-detail-right .sub-images {
        gap: 6px;
    }
    .product-detail-right .sub-images img {
        width: calc(33.33% - 4px);
        max-width: 200px;
        min-width: 60px;
    }
    .ai-chat-container {
        margin: 10px;
    }
    .ai-chat-header h3 {
        font-size: 0.9rem;
    }
    .ai-chat-input textarea {
        height: 40px;
        font-size: 0.8rem;
    }
    .ai-chat-buttons {
        flex-direction: column;
        gap: 10px;
    }
    .ai-chat-buttons input[type="file"] {
        width: 100%;
    }
    .ai-chat-buttons button {
        width: 100%;
        padding: 5px;
        font-size: 0.8rem;
    }
}

/* 媒体查询 - 手机设备（横屏），Safari缩放一半 */
@media (max-width: 480px) and (orientation: landscape) {
    html {
        font-size: 12px;
    }
    .header {
        padding: 10px 5px 5px;
    }
    .header img {
        height: 67px;
        margin-top: -5px;
    }
    .nav {
        padding: 3.5px 5px;
        margin-top: -7.5px;
    }
    .nav a {
        margin: 0 6px;
        font-size: 0.275rem;
        padding: 3px 5px;
    }
    .lang-switch {
        top: 5px;
        right: 5px;
    }
    .lang-switch a {
        font-size: 0.25rem;
        padding: 1px 2.5px;
    }
    .container {
        margin: 15px auto;
        padding: 0 3.5px;
    }
    .container h2.welcome-title {
        font-size: 0.625rem !important;
        margin-bottom: 7.5px;
    }
    .container p {
        font-size: 0.275rem !important;
        max-width: 200px;
        margin: 0 auto 5px;
    }
    .search-bar {
        margin-bottom: 3.5px;
        gap: 2.5px;
    }
    .search-bar input[type="text"],
    .search-bar button {
        padding: 2px 3.5px;
        height: 9px;
        font-size: 0.25rem;
    }
    .search-bar input[type="text"] {
        width: 50px;
    }
    .search-bar button {
        width: 25px;
    }
    .category-bar {
        gap: 5px;
        margin-bottom: 5px;
    }
    .category-bar a {
        font-size: 0.275rem;
        padding: 2px 3.5px;
    }
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 5px;
        margin-top: 5px;
    }
    .product-item {
        padding: 2.5px;
    }
    .product-item img {
        height: 50px;
        border-radius: 1px;
    }
    .product-item h3 {
        font-size: 0.275rem;
        margin: 0 0 2px;
    }
    .product-item .price {
        font-size: 0.3rem;
        margin: 1px 0;
    }
    .product-item p {
        font-size: 0.225rem;
        -webkit-line-clamp: 2;
    }
    .cta-button {
        padding: 2px 3.5px;
        font-size: 0.225rem;
        margin-top: 2.5px;
    }
    .timeline-item {
        padding: 3.5px;
    }
    .timeline-item h3 {
        font-size: 0.375rem;
    }
    .timeline-item p {
        font-size: 0.275rem;
    }
    .news-item {
        padding: 3.5px;
    }
    .news-item h3 {
        font-size: 0.375rem;
    }
    .news-item .news-date {
        font-size: 0.225rem;
    }
    .news-item p {
        font-size: 0.275rem;
    }
    .news-images {
        gap: 2.5px;
        margin-top: 2.5px;
    }
    .news-images img {
        width: 37.5px;
    }
    .footer {
        padding: 7.5px 3.5px;
    }
    .footer-content {
        gap: 3.5px;
    }
    .footer-content p {
        font-size: 0.2375rem;
    }
    .footer-content .contact-info {
        gap: 5px;
    }
    #world-map, #country-map {
        height: 125px;
        margin: -5px auto 5px;
    }
    .product-detail {
        padding: 5px;
        gap: 5px;
        margin-top: 5px;
    }
    .product-detail-left .main-image {
        width: 100%;
        height: auto;
        object-fit: contain;
        border-radius: 5px;
        cursor: pointer;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        max-height: 200px;
        min-height: 100px;
    }
    .product-detail-right .sub-images {
        gap: 4px;
    }
    .product-detail-right .sub-images img {
        width: calc(33.33% - 3px);
        max-width: 100px;
        min-width: 40px;
    }
}