/* Base Typography Styles */
.prose {
    max-width: none;
}

.prose img {
    max-width: 100%;
    height: auto;
    margin: 1rem auto;
}

.prose h1 {
    font-size: 1.5rem;
    line-height: 2rem;
    margin: 1.5rem 0;
}

.prose h2 {
    font-size: 1.25rem;
    line-height: 1.75rem;
    margin-top: 1.25rem;
    margin-bottom: 0.75rem;
}

.prose p {
    margin: 1rem 0;
    font-size: 0.875rem;
    line-height: 1.5rem;
}

.prose ul,
.prose ol {
    padding-left: 1.5rem;
    margin: 1rem 0;
}

.prose li {
    margin: 0.5rem 0;
}

.prose table {
    width: 100%;
    overflow-x: auto;
    display: block;
    margin: 1rem 0;
}

.prose table td,
.prose table th {
    padding: 0.5rem;
    border: 1px solid #e5e7eb;
}

.prose a {
    color: #ef4444;
    text-decoration: none;
}

.prose a:hover {
    text-decoration: underline;
}

.prose iframe {
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 16/9;
}

/* Header Components */
.header-search {
    transition: all 0.3s ease;
}

.header-search.expanded {
    width: 300px;
}

/* Language Selector */
.language-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    box-: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 9999;
}

.language-dropdown.show {
    display: block;
}

.language-dropdown a {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    min-width: 160px;
    white-space: nowrap;
}

.language-dropdown a.active {
    background-color: #f3f4f6;
    color: #ef4444;
}

.language-dropdown a:hover {
    background-color: #f3f4f6;
}

.language-dropdown a svg {
    margin-right: 0.5rem;
    flex-shrink: 0;
}

/* Product Components */
.product-categories {
    padding: 15px;
    box-: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.category-tree {
    list-style: none;
    padding: 0;
}

.category-item {
    position: relative;
    max-width: 100%;
    overflow: hidden;
}

.category-link {
    display: block;
    padding: 2px 15px 2px 25px;
    color: #333;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: break-all;
}

.category-link:hover {
    background-color: #f3f4f6;
    color: #ef4444;
    white-space: normal;
    word-wrap: break-word;
}

.category-link.active {
    background-color: #f3f4f6;
    color: #ef4444;
    font-weight: bold;
}

/* Mobile Menu */
.mobile-menu {
    transition: transform 0.3s ease-in-out;
    transform: translateX(-100%);
}

.mobile-menu.show {
    transform: translateX(0);
}

.mobile-submenu,
.mobile-child-menu {
    transition: all 0.2s ease-in-out;
}

/* Utility Classes */
.three-line-text {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.aspect-w-1 {
    position: relative;
    padding-bottom: 100%;
}

.aspect-w-1 img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.rotate-180 {
    transform: rotate(180deg);
}

/* Media Queries */
@media (min-width: 768px) {
    .prose h1 {
        font-size: 2rem;
        line-height: 2.5rem;
        margin: 2rem 0;
    }

    .prose h2 {
        font-size: 1.5rem;
        line-height: 2rem;
        margin-top: 1.5rem;
        margin-bottom: 1rem;
    }

    .prose p {
        font-size: 1rem;
        line-height: 1.75rem;
    }

    .filter-content {
        padding: 1rem;
    }
}

@media (max-width: 768px) {
    .header-search.expanded {
        width: 200px;
    }

    .language-dropdown {
        position: fixed;
        top: 40px;
        right: 4px;
        max-width: 160px;
        min-width: 160px !important;
        width: auto;
    }

    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (max-width: 640px) {
    .pagination button {
        min-width: 1.5rem;
    }
}

/* 从 about.html 提取的样式 */
.prose img {
    max-width: 100%;
    height: auto;
    margin: 1rem auto;
}

.prose h1 {
    font-size: 1.5rem;
    line-height: 2rem;
    margin: 1.5rem 0;
}

@media (min-width: 768px) {
    .prose h1 {
        font-size: 2rem;
        line-height: 2.5rem;
        margin: 2rem 0;
    }
}

.prose p {
    margin: 1rem 0;
    font-size: 0.875rem;
    line-height: 1.5rem;
}

@media (min-width: 768px) {
    .prose p {
        font-size: 1rem;
        line-height: 1.75rem;
    }
}

.prose ul,
.prose ol {
    padding-left: 1.5rem;
    margin: 1rem 0;
}

.prose li {
    margin: 0.5rem 0;
}

.prose table {
    width: 100%;
    overflow-x: auto;
    display: block;
    margin: 1rem 0;
}

.prose table td,
.prose table th {
    padding: 0.5rem;
    border: 1px solid #e5e7eb;
}

.prose a:hover {
    text-decoration: underline;
}

.prose iframe {
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 16/9;
}

/* 从 category_footer.html 提取的样式 */
.three-line-text {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 从 language.html 提取的样式 */
.language-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    box-: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 9999;
}

.language-dropdown.show {
    display: block;
}

#languageToggle {
    position: relative;
    z-index: 9999;
}

.language-dropdown a {
    position: relative;
    z-index: 9999;
}

@media (max-width: 768px) {
    .language-dropdown {
        position: fixed;
        top: 40px;
        right: 4px;
        max-width: 160px;
    }
}

/* 从 news_detail.html 和 index.html 提取的样式 */
.prose {
    max-width: none;
}

.prose h1 {
    font-size: 1.5rem;
    line-height: 2rem;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.prose h2 {
    font-size: 1.25rem;
    line-height: 1.75rem;
    margin-top: 1.25rem;
    margin-bottom: 0.75rem;
}

.prose p {
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
    line-height: 1.625;
}

@media (min-width: 768px) {
    .prose h1 {
        font-size: 2rem;
        line-height: 2.5rem;
        margin-top: 2rem;
        margin-bottom: 1.5rem;
    }

    .prose h2 {
        font-size: 1.5rem;
        line-height: 2rem;
        margin-top: 1.5rem;
        margin-bottom: 1rem;
    }

    .prose p {
        margin-top: 1rem;
        margin-bottom: 1rem;
        line-height: 1.75;
    }
}

/* Product Details styles */
.product-details {
    margin: 50px 0;
}

.product-details .product-title {
    font-weight: 500;
    margin-bottom: 20px;
}

.product-details .product-price {
    margin: 30px 0;
}

.gallery-wrap .img-big-wrap img {
    height: 450px;
    width: auto;
    display: inline-block;
    cursor: zoom-in;
}

.gallery-wrap .img-small-wrap .item-gallery {
    width: 60px;
    height: 60px;
    border: 1px solid #ddd;
    margin: 7px 2px;
    display: inline-block;
    overflow: hidden;
}

.gallery-wrap .img-small-wrap {
    text-align: center;
}

.gallery-wrap .img-small-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    border-radius: 4px;
    cursor: zoom-in;
}

/* News styles */
.news-card {
    transition: transform 0.3s ease;
}

.news-card:hover {
    transform: translateY(-5px);
}

.news-image {
    height: 200px;
    object-fit: cover;
}

@media (max-width: 768px) {
    .news-image {
        height: 150px;
    }
}

/* Search styles */
.search-result-item {
    transition: all 0.3s ease;
}

.search-result-item:hover {
    transform: translateY(-2px);
    box-: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.search-image {
    height: 160px;
    object-fit: contain;
}

@media (max-width: 768px) {
    .search-image {
        height: 120px;
    }
}

/* Category styles */
.category-card {
    transition: all 0.3s ease;
}

.category-card:hover {
    transform: translateY(-5px);
    box-: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.category-image {
    height: 180px;
    object-fit: contain;
}

@media (max-width: 768px) {
    .category-image {
        height: 140px;
    }
}

.subcategory-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.subcategory-list.show {
    max-height: 500px;
}

/* Contact styles */
.contact-info-card {
    transition: all 0.3s ease;
}

.contact-info-card:hover {
    transform: translateY(-5px);
    box-: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.contact-icon {
    width: 40px;
    height: 40px;
    background-color: #ef4444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

@media (max-width: 768px) {
    .contact-icon {
        width: 32px;
        height: 32px;
    }
}

/* Filter styles */
.filter-content {
    padding: 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    margin-top: 0.5rem;
}

@media (min-width: 768px) {
    .filter-content {
        padding: 1rem;
    }
}

.filter-content span {
    font-weight: 300;
}

/* Responsive layout adjustments */
@media (max-width: 768px) {
    .product-list {
        padding: 0.5rem;
    }

    .category-description {
        padding: 0.75rem;
    }

    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Pagination responsive */
@media (max-width: 640px) {
    .pagination button {
        min-width: 1.5rem;
    }
}

/* News Detail styles */
.news-content img {
    max-width: 100%;
    height: auto;
    margin: 1rem auto;
}

.news-content p {
    margin: 1rem 0;
    line-height: 1.75;
}

.news-content h1,
.news-content h2 {
    margin: 1.5rem 0 1rem;
    font-weight: 600;
}

.news-content h1 {
    font-size: 1.5rem;
}

.news-content h2 {
    font-size: 1.25rem;
}

@media (min-width: 768px) {
    .news-content h1 {
        font-size: 2rem;
    }

    .news-content h2 {
        font-size: 1.5rem;
    }
}

/* Form styles */
.form-group {
    margin-bottom: 1rem;
}

.form-control {
    transition: border-color 0.15s ease-in-out, box- 0.15s ease-in-out;
}

.form-control:focus {
    border-color: #ef4444;
    box-: 0 0 0 0.2rem rgba(239, 68, 68, 0.25);
}

.form-label {
    font-size: 0.875rem;
    color: #4b5563;
    margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
    .form-label {
        font-size: 0.75rem;
    }
}

/* Header styles */
.header-search {
    transition: all 0.3s ease;
}

.header-search.expanded {
    width: 300px;
}

@media (max-width: 768px) {
    .header-search.expanded {
        width: 200px;
    }
}

.menu-item {
    position: relative;
}

.menu-item:hover .submenu {
    display: block;
}

.submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: white;
    box-: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.mobile-menu {
    transition: transform 0.3s ease-in-out;
    transform: translateX(-100%);
}

.mobile-menu.show {
    transform: translateX(0);
}

/* Navigation styles */
.breadcrumb-item {
    position: relative;
    padding-right: 1.5rem;
}

.breadcrumb-item:not(:last-child)::after {
    content: '>';
    position: absolute;
    right: 0.5rem;
    color: #9ca3af;
}

.breadcrumb-link {
    transition: color 0.2s ease;
}

.breadcrumb-link:hover {
    color: #ef4444;
}

@media (max-width: 768px) {
    .breadcrumb-item {
        padding-right: 1rem;
    }

    .breadcrumb-item:not(:last-child)::after {
        right: 0.25rem;
    }
}

/* Footer styles */
.footer-link {
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: #ef4444;
}

.footer-heading {
    position: relative;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.footer-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: #ef4444;
}

.footer-contact-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.footer-contact-icon {
    width: 20px;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .footer-heading {
        margin-bottom: 0.75rem;
    }

    .footer-contact-item {
        margin-bottom: 0.5rem;
    }
}

/* Search page styles */
.search-input {
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
}

.search-input:focus {
    border-color: #ef4444;
    box-: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.search-button {
    transition: all 0.3s ease;
}

.search-button:hover {
    background-color: #dc2626;
}

.search-result {
    transition: transform 0.3s ease;
}

.search-result:hover {
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .search-input {
        font-size: 0.875rem;
    }

    .search-button {
        padding: 0.5rem 1rem;
    }
}

.category-search {
    transition: all 0.3s ease;
}

.category-search:focus {
    border-color: #ef4444;
    box-: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.category-list {
    max-height: 600px;
    overflow-y: auto;
}

.category-list::-webkit-scrollbar {
    width: 4px;
}

.category-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.category-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 2px;
}

.category-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 产品分类样式 */
.product-categories {
    /* background: white; */
    padding: 15px;
    box-: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* 分类树样式 */
.category-tree {
    list-style: none;
    padding: 0;
}

/* 分类项样式 */
.category-item {
    position: relative;
    max-width: 100%;
    overflow: hidden;
}

/* 分类链接样式 */
.category-link {
    display: block;
    padding: 2px 15px 2px 25px;
    color: #333;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: break-all;
}

/* 鼠标悬停时显示完整文本 */
.category-link:hover {
    background-color: #f3f4f6;
    color: #ef4444;
    white-space: normal;
    word-wrap: break-word;
}

/* 子类别样式 */
.subcategory {
    list-style: none;
    padding-left: 2em;
    display: none;
}

/* 当分类项有expanded类时显示子类别 */
.category-item.expanded>.subcategory {
    display: block;
}

/* 展开状态下箭头旋转 */
.category-item.expanded>.category-link .arrow-icon {
    transform: translateY(-50%) rotate(90deg);
    transition: transform 0.3s ease;
}

/* 箭头图标样式 */
.arrow-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: #666;
    transition: transform 0.3s ease;
}

/* 保持鼠标悬停时显示子类别 */
.category-item:hover>.subcategory {
    display: block;
}

/* 标题箭头样式 */
h3 .arrow-icon {
    transform: rotate(90deg);
    top: 25%;
}

/* 添加选中状态样式 */
.category-link.active {
    background-color: #f3f4f6;
    color: #ef4444;
    font-weight: bold;
}

/* 菜单基础样式 */
.nav-menu {
    position: relative;
    font-weight: 800;
    font-size: 16px;
}
.nav-menu .relative {
    position: relative;
}

/* 一级菜单样式 */
.menu-level-1 {
    position: absolute;
    top: 100%;
    left: 0;
    /* max-width: 200px; */
    z-index: 1000;
    background: white;
    box-: 0 2px 5px rgba(0, 0, 0, 0.2);
    min-width: 200px;
    max-width: 300px;
    white-space: normal;
    font-weight: normal;
    font-size: 13px;
}

.menu-level-1 a {
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.4;
    padding: 8px 12px;
}

/* 子菜单通用样式 */
.nav-menu li>ul {
    position: absolute;
    /* left: 100%; */
    /* 固定在父级菜单右侧 */
    top: 0;
    right: 20px;
    /* 与父级菜单项对齐 */
    min-width: 200px;
    background: white;
    box-: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 1001;
}

/* 菜单项样式 */
.nav-menu li {
    position: relative;
    white-space: nowrap;
}

/* 有子菜单的项添加箭头 */
.nav-menu li:has(> ul)>a::after {
    content: '›';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

/* 菜单项内边距和悬停效果 */
.nav-menu li a {
    display: block;
    padding: 8px 25px 8px 15px;
    /* 右侧留出箭头空间 */
    position: relative;
}

/* 悬停显示子菜单 */
.nav-menu .relative:hover>.menu-level-1,
.nav-menu li:hover>ul {
    display: block;
}

/* 移动端菜单过渡动画 */
#mobile-menu {
    transition: all 0.3s ease-in-out;
}

/* 移动端子菜单过渡动画 */
.mobile-submenu,
.mobile-child-menu {
    transition: all 0.2s ease-in-out;
}

/* 箭头旋转动画 */
.rotate-180 {
    transform: rotate(180deg);
}

/* 当前选中的语言项样式 */
.language-dropdown a.active {
    background-color: #f3f4f6;
    color: #ef4444;
}

/* 语言选项悬停效果 */
.language-dropdown a:hover {
    background-color: #f3f4f6;
}

/* 语言图标和文字对齐 */
.language-dropdown a {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    min-width: 160px;
    white-space: nowrap;
}

.language-dropdown a svg {
    margin-right: 0.5rem;
    flex-shrink: 0;
}

/* 确保下拉框在移动端也保持合适的宽度 */
@media (max-width: 768px) {
    .language-dropdown {
        min-width: 160px !important;
        width: auto;
    }
}