/* --- 1. 基礎設定與字體 (Base Styles) --- */
html {
    scroll-behavior: smooth;
}

body {
    font-family: "Microsoft JhengHei", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
    margin: 0;
    padding: 0;
}

/* --- 2. 主容器佈局 (Layout) --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: #FFFFEB; /* 宏翔傳統淺米色背景 */
    padding: 20px 40px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.content-wrapper {
    display: flex;
    gap: 40px;
}

.sidebar {
    flex: 0 0 250px;
    background-color: #f9fbfb;
    padding: 20px;
    border-right: 1px solid #ddd;
}

.main-content {
    flex: 1;
}

.full-main-content {
    width: 100%;
}

/* --- 3. 頁首與頂部導覽 (Header & Main Nav) --- */
header {
    text-align: center;
    padding: 20px 0;
}

header img {
    max-width: 300px;
    height: auto;
}

nav {
    background-color: #008080; /* 宏翔綠 */
    padding: 10px;
    text-align: center;
    margin-bottom: 30px;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 10px 15px;
    font-size: 16px;
    transition: all 0.3s ease;
}

nav a.active-page {
    font-size: 19px;
    font-weight: 900;
    color: #FFFFEB;
    border-bottom: 3px solid #FFFFEB;
}

nav a:hover {
    color: #FFFFEB;
    text-decoration: underline;
}

/* --- 4. 地址資訊樣式 (Address Info) --- */
.address-info {
    margin-top: 15px;
    line-height: 1.4;
    color: #555;
    text-align: center;
}

.address-info address {
    font-style: normal;
}

.addr-zh {
    font-weight: bold;
    color: #333;
    font-size: 1.1em;
    margin: 0;
}

.addr-en {
    font-size: 0.9em;
    color: #333;
    margin: 2px 0;
}

.addr-contact {
    margin: 5px 0;
    font-size: 0.95em;
}

.addr-contact strong {
    color: #008080;
}

.addr-person {
    margin-top: 8px;
    padding: 2px 0;
    display: inline-block;
    font-size: 0.95em;
}

/* --- 5. 側邊欄選單 (Sidebar Menu) --- */
.sidebar h3 {
    color: #008080;
    border-bottom: 2px solid #008080;
    padding-bottom: 10px;
}

.product-menu {
    list-style: none;
    padding: 0;
}

.product-menu li {
    margin: 10px 0;
}

.sub-item a {
    text-decoration: none;
    color: #666;
    display: block;
    padding: 5px 10px;
}

.sub-item a:hover, .sub-item a.active {
    background-color: #008080;
    color: white !important;
    border-radius: 4px;
}

.sidebar .back-catalog-header {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #008080;
}

.sidebar .back-link {
    color: #008080 !important;
    font-weight: bold;
    text-decoration: none;
}

/* --- 6. 表格與數據 (Tables) --- */
.table-container {
    overflow-x: auto;
    margin: 20px 0;
}

.spec-table, .data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.spec-table th, .spec-table td, 
.data-table th, .data-table td {
    border: 1px solid #ddd;
    padding: 12px;
}

.spec-table th, .sub-header {
    background-color: #FF9999; /* 宏翔參數表經典粉紅色 */
    color: #333;
    font-weight: bold;
}

.cert-box {
    background-color: #EBF7FF;
    border: 1px solid #66CCFF;
    padding: 20px;
    margin: 20px 0;
}

/* --- 7. 產品與實績網格 (Grids) --- */
.product-grid, .gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.product-card {
    border: 1px solid #ddd;
    padding: 15px;
    background: white;
    text-align: center;
    transition: transform 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    border-color: #008080;
}

.product-card img, .gallery img {
    max-width: 100%;
    height: auto;
    object-fit: cover;
}

.main-rack-img {
    max-width: 100%;
    height: auto;
    margin: 20px 0;
}

/* --- 8. 通用元件 --- */
.action-btn {
    display: inline-block;
    background-color: #008080;
    color: white;
    padding: 12px 25px;
    text-decoration: none;
    font-weight: bold;
    border-radius: 5px;
    margin: 5px;
}

.action-btn:hover {
    background-color: #006666;
}

.back-to-top {
    text-align: right;
    margin-top: 40px;
    padding-top: 15px;
    border-top: 1px dashed #ddd;
}

.back-to-top a {
    text-decoration: none;
    color: #008080;
    font-weight: bold;
}

/* --- 9. 響應式設計 (Responsive Optimization) --- */

@media (max-width: 768px) {
    .container {
        padding: 15px 20px;
    }

    .content-wrapper {
        flex-direction: column;
        gap: 0;
    }

    .sidebar {
        flex: none;
        width: 100%;
        border-right: none;
        border-bottom: 2px solid #008080;
        padding: 10px 0;
        position: -webkit-sticky;
        position: sticky;
        top: 0;
        z-index: 100;
        background-color: #f9fbfb;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }

    .sidebar h3 {
        display: none;
    }

    .product-menu {
        display: flex;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        margin: 0;
        padding: 5px 10px;
    }

    .product-menu li {
        margin: 0 10px 0 0;
        display: inline-block;
    }

    .sidebar .back-catalog-header {
        display: none;
    }

    nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }

    nav a {
        font-size: 14px;
        padding: 8px;
    }

    .contact-grid {
        display: block !important;
    }

    .map-container {
        height: 300px !important;
    }

    .inquiry-form input, .inquiry-form textarea {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
}

/* --- 10. 頁尾 --- */
footer {
    text-align: center;
    padding: 30px 0;
    font-size: 0.9em;
    color: #666;
    border-top: 1px solid #ddd;
    margin-top: 50px;
}



/* Create a special class for a centered, narrower layout */
.centered-content {
    max-width: 900px; /* This matches the typical width of the 'main-content' on other pages */
    margin: 0 auto;
    padding: 20px 0;
}



/* --- 機櫃尺寸表專用樣式 (Rack Size Table Styles) --- */
.size-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.95em;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05); /* 輕微陰影增加立體感 */
}

.size-table thead tr {
    background-color: #008080; /* 宏翔綠表頭 */
    color: #ffffff;
    text-align: left;
}

.size-table th, 
.size-table td {
    padding: 12px 15px;
    border: 1px solid #ddd;
}

/* 第一欄 (型號) 加粗並給予淡色背景 */
.size-table td:first-child {
    font-weight: bold;
    color: #006666;
    background-color: #fcfcfc;
}

/* 偶數行底色 (Zebra Striping) - 讓閱讀不跑行 */
.size-table tbody tr:nth-of-type(even) {
    background-color: #f3f3f3;
}

/* 滑鼠懸停效果 (Hover Highlight) */
.size-table tbody tr:hover {
    background-color: #e0f2f1; /* 淡綠色高亮 */
    cursor: default;
    transition: background-color 0.2s ease;
}

/* 分隔標題行 (Section Separators) */
.section-row {
    background-color: #FF9999 !important; /* 經典粉紅分隔線 */
    color: #333;
    font-weight: bold;
    text-align: center;
    letter-spacing: 1px;
}


/* Add this to your CSS if you haven't already */
.section-row td {
    background-color: #FFD1D1 !important; /* Pink header */
    color: #000;
    font-weight: bold;
    text-align: center;
    letter-spacing: 1px;
}