/* Loading screen styles */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.loading-top {
    position: absolute;
    top: 0;
    width: 100%;
    height: 50%;
    background-color: #647185;
    transition: transform 0.5s ease;
    transform: translateY(0);
    display: flex;
    justify-content: center;
    align-items: flex-end;
    margin-bottom: 20px;
    font-size: 150px;
    font-weight: bold;
    -webkit-text-stroke: 2px #54c7dd;
    text-stroke: 2px black;
    color: #54c7dd;
    letter-spacing: 5px;
    border-bottom: 1px solid #54c7dd;
}

.loading-bottom {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 50%;
    background-color: #647185;
    transition: transform 0.5s ease;
    transform: translateY(0);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    margin-top: 20px;
    font-size: 100px;
    font-weight: bold;
    -webkit-text-stroke: 2px #54c7dd;
    text-stroke: 2px black;
    color: #54c7dd;
    letter-spacing: 10px;
}

#loading-screen.hidden .loading-top {
    transform: translateY(-100%);
}

#loading-screen.hidden .loading-bottom {
    transform: translateY(100%);
}

/* Existing styles */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: Arial, sans-serif; }

.navbar {
    height: 60px;
    background-color: rgba(0,0,0,0.4);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

.logo img { height: 60px; }

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    color: #d3d3d3;
    font-size: 16px;
    font-weight: bold;
    text-decoration: none;
    transition: color 0.3s;
}

.nav-links a:hover { color: #ffffff; }

.nav-links a.active { color: #ffffff; }

.slideshow {
    height: 100vh;
    position: relative;
    background-image: url('image/banner01.jpg');
    background-size: cover;
    background-position: center;
}

.introduce {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-left: 100px;
    font-size: 30px;
    font-weight: bold;
    color: white;
    gap: 20px;
    letter-spacing: 2px;
}

.aboutus {
    height: 100vh;
    background-color: #f5f5f5;
    padding-top: 60px;
    background-image: url('image/aboutus.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

.about-us-title {
    text-align: center;
    height: 10vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.e-title{
    font-size: 15px;   
}
.c-title{
    font-size:30px;
    font-weight:bold
}

.company-section {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    position: relative;
    overflow: hidden;
}

.company-image, .company-info {
    width: 45%;
    height: 70vh;
    background-color: rgba(0,0,0,0.6);
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    color: white;
}

.company-image {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-right: 2px solid black;
}

.company-image img { width: 30%; }

.company-info h3 { font-size: 24px; margin-bottom: 20px; }
.company-info p { font-size: 16px; line-height: 1.5; }
.company-info img { width: 100%; margin-top: 50px;}

.advantage {
    display: flex;
    flex-direction: row;
}

.advantage-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 65%;
    margin-left: 2.5%;
    gap: 5px;
}
.advantage-name{
    font-size: 20px;
}
.advantage-introduce{
    font-size: 15px;
}
.product {
    height: 100vh;
    background-color: #E6F7FF;
    padding-top: 60px;
}

.product-container {
    width: 100%;
    margin: 0px auto;
    display: flex;
    justify-content: center;
    gap: 20px;
    position: relative;
}

.color-track {
    display: flex;
    justify-content: center;
    gap: 20px;
    width: 100%;
}

.color-track img {
    width: 25%;
    object-fit: cover;
}

.ykk-track {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 50px;
    width: 100%;
    overflow: hidden;
}

.ykk-track img {
    width: 24%;
    object-fit: cover;
    transition: all 0.5s ease;
    opacity: 1;
}

.ykk-track img.fade-out {
    opacity: 0;
    transform: translateX(50px);
}

.ykk-track img.fade-in {
    opacity: 1;
    transform: translateX(0);
}

.ykk-nav {
    position: absolute;
    top: 50%;
    width: 90%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
}

.ykk-nav button {
    background-color: rgba(255, 255, 255, 0.8);
    border: none;
    height: 50px;
    width: 50px;
    cursor: pointer;
    font-size: 18px;
    border-radius: 5px;
    transition: background-color 0.3s;
    border-radius: 50%;
    color: white;
    background-color: #647185;
}

.ykk-nav button:hover {
    background-color: #54c7dd;
}

.contact {
    height: 100vh;
    background-image: url('image/contactus.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    color: white;
}

.contactaddheight{
    height: 60px;
}
.contact-top {
    height: 20%;
    margin-left: 50px;
    font-size: 30px;
    font-weight: bold;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    letter-spacing: 0.5px;
}

.contact-middle {
    height: 15%;
    width: 35%;
    margin-left: 50px;
    font-size: 15px;
    font-weight: bold;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
}

.contact-bottom {
    height: 45%;
    margin-left: 50px;
    font-size: 15px;
    font-weight: bold;
    display: flex;
    flex-direction: row;
    align-items: center;
}

html {
    scroll-behavior: smooth;
    overflow: hidden;
}

body {
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

body::-webkit-scrollbar {
    display: none;
}

.slideshow,
.aboutus,
.product,
.contact {
    scroll-snap-align: start;
    height: 100vh;
    overflow-y: auto;
}

.pdt {
    height: calc(90vh - 60px);
    display: flex;
}

.left-nav {
    width: 250px;
    background-color: #ffffff;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    overflow-y: hidden;
    text-align: center;
}

.category-list-container {
    flex-grow: 1;
    overflow-y: auto;
}

.category-list {
    list-style-type: none;
    padding: 0;
}

.category-item {
    padding: 10px;
    cursor: pointer;
    background-color: #647185;
    border-bottom: 1px solid #aaa;
    color: white;
}

.category-item:hover {
    background-color: #54c7dd;
}

.category-item.active {
    background-color: #54c7dd;
    font-weight: bold;
    color: white;
}

.main-content {
    flex-grow: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px 20px;
    font-size: 13px;
    background-color: white;
}

.file-list {
    list-style-type: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 10px;
}

.file-item {
    padding: 8px;
    border: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    text-align: center;
}

.file-item.directory {
    background-color: #f9f9f9;
}

.file-icon {
    margin-bottom: 5px;
    width: 100px;
    height: 100px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.file-icon.image {
    width: 200px;
    height: 200px;
    object-fit: cover;
}

.pagination {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.pagination button {
    padding: 5px 10px;
    cursor: pointer;
}

.pagination button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    justify-content: center;
    align-items: center;
}

.modal-content {
    position: relative;
    max-width: 900px;
    max-height: 700px;
    margin: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease-out;
}

.preview-image {
    width: 300px;
    height: 300px;
    transition: all 0.3s ease;
}

.image-name {
    color: white;
    font-size: 16px;
    text-align: center;
    padding: 5px 0;
    word-break: break-all;
    max-width: 100%;
}

.close {
    position: absolute;
    top: -30px;
    right: -30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 101;
}

.navigation {
    display: flex;
    gap: 20px;
    padding: 10px;
}

.nav-button1 {
    padding: 8px 16px;
    background-color: #ffffff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.inventory-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

#inventoryTable {
    width: 100%;
    border-collapse: collapse;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#inventoryTable th,
#inventoryTable td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

#inventoryTable th {
    background-color: #f4f4f4;
    font-weight: bold;
}

#inventoryTable tr:hover {
    background-color: #f9f9f9;
}

#inventoryTable td {
    color: #333;
}
        
/* 手机自适应样式 */
@media only screen and (max-width: 768px) {
    /* 全局调整 */
    body {
        font-size: 14px;
        overflow-x: hidden;
    }

    /* Loading screen */
    #loading-screen .loading-top {
        font-size: 80px;
        -webkit-text-stroke: 1px #54c7dd;
    }

    #loading-screen .loading-bottom {
        font-size: 60px;
        -webkit-text-stroke: 1px #54c7dd;
        letter-spacing: 5px;
    }

    /* 导航栏 */
    .navbar {
        height: 5vh;
        position: fixed;
        width: 100%;
        z-index: 1000;
        background-color: rgba(0,0,0,0.4);

    }

    .logo img {
        height: 5vh;
    }

    .nav-links {
        display: none; /* 默认隐藏导航链接 */
        position: absolute;
        top: 5vh;
        left: 0;
        width: 100%;
        background-color: rgba(0, 0, 0, 0.8);
        flex-direction: column;
        gap: 10px;
        padding: 10px 0;
    }

    .nav-links.active {
        display: flex; /* 点击汉堡菜单后显示 */
    }

    .nav-links a {
        font-size: 14px;
        padding: 10px;
        text-align: center;
    }

    /* 添加汉堡菜单按钮 */
    .navbar::after {
        content: "☰";
        position: absolute;
        right: 10px;
        top: 0.8vh;
        font-size: 3vh;
        color: #d3d3d3;
        cursor: pointer;
    }

    /* 幻灯片部分 */
    .slideshow {
        height: 100vh;
    }

    .introduce {
        margin-left: 20px;
        font-size: 18px;
        gap: 10px;
    }

    /* 关于我们 */
    .aboutus {
        height: 100vh;
        padding-top: 5vh;
    }

    .about-us-title {
        display: flex;
        height: 8vh;
    }

    .e-title{
        font-size: 1.5vh;   
    }
    .c-title{
        font-size: 2.5vh;
        font-weight:bold
    }

    .company-section {
        flex-direction: column;
        align-items: center;
    }

    .company-image {
        height: 45vh;
        width: 95%;
    }
    .company-info {
        margin-top: 2vh;
        height: 38vh;
        width: 95%;
        padding: 0px;
    }

    .company-image img {
        height: 100%;
    }

    .advantage {
        height: 18%;
        flex-direction: row;
        align-items: center;
    }

    .advantage-content {
        width: 100%;
        margin-left: 10px;
    }
    .advantage-name{
        font-size: 15px;
    }
    .advantage-introduce{
        font-size: 10px;
    }

    .company-info h3 { font-size: 18px; }
    .company-info p { font-size: 12px; line-height: 1.5; }
    .company-info img { margin-top: 20px; }
    /* 产品展示 */
    .product {
        height: 100vh;
        padding-top: 5vh;
    }

    .pdt {
        flex-direction: column;
        height: auto;
    }
    .product-container {
        width: 100%;
        height: 87vh;
        margin: 0px auto;
        display: flex;
        justify-content: center;
        gap: 20px;
        position: relative;
    }
    
    .left-nav {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #ddd;
    }
    .category-list {
        display: flex; /* 使用 flex 布局 */
        flex-direction: row; /* 横向排列 */
        height: 5vh;
        width: 100%;
    }
    .category-item {
        width: 20%;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .main-content {
        width: 100%;
        height: 83vh;
    }

    .file-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 1px;
    }

    .file-item {
        padding: 1px;
    }

    .file-icon {
        width: 60px;
        height: 60px;
    }

    .file-icon.image {
        width: 120px;
        height: 70px;
    }

    .pagination {
        margin: 10px 0;
    }

    .modal-content {
        max-width: 90%;
        max-height: 80vh;
    }

    .preview-image {
        width: 200px;
        height: 200px;
    }

    .close {
        top: -20px;
        right: -20px;
        font-size: 30px;
    }

    .color-track {
        display: grid;
        grid-template-columns: repeat(2, 1fr); /* Two columns for the top row */
        grid-template-rows: auto auto; /* Two rows */
        justify-items: center;
        gap: 0 10px; /* No row gap (0), 10px column gap between top images */
        padding: 0 10px; /* Optional: Add padding to prevent edge clipping */
    }

    .color-track img {
        width: 100%; /* Full width of the grid cell */
        object-fit: cover; /* Uniform scaling */
        margin: 0; /* No margins */
    }

    .color-track img:nth-child(3) {
        grid-column: span 2; /* Span across both columns */
        width: 50%; /* Natural sizing within max-width */
        object-fit: cover; /* Consistent scaling */
    }

    /* YKK色卡 */
    .ykk-track {
        gap: 20px;
    }

    .ykk-track img {
        width: 85%;
    }

    .ykk-nav {
        width: 100%;
    }

    .ykk-nav button {
        height: 40px;
        width: 40px;
        font-size: 16px;
    }

    /* 联系我们 */
    .contact {
        height: 100vh;
    }

    .contact-top {
        height: 15vh;
        margin-left: 20px;
        font-size: 18px;
    }

    .contact-middle {
        height: 15vh;
        width: 90%;
        margin-left: 20px;
        font-size: 12px;
    }

    .contact-bottom {
        height: 50vh;
        flex-direction: column;
        align-items: flex-start;
        margin-left: 20px;
        gap: 20px;
    }

    .contact-bottom div:first-child {
        font-size: 10px;
    }

    .contact-bottom div:last-child {
        width: 100%;
        margin-left: 0;
    }
    
    .contactaddheight{
        height: 5vh;
    }
}

/* 平板设备调整 (768px - 1024px) */
@media only screen and (min-width: 769px) and (max-width: 1024px) {
    .navbar {
        padding: 0 15px;
    }

    .nav-links {
        gap: 20px;
    }

    .introduce {
        margin-left: 50px;
        font-size: 24px;
    }

    .company-image, .company-info {
        width: 48%;
    }

    .file-list {
        grid-template-columns: repeat(3, 1fr);
    }

    .color-track img {
        width: 30%;
    }

    .ykk-track img {
        width: 30%;
    }
}