/* ==========================================================================
   聚興 Juxing — Stylesheet (Production)
   單檔組織，依下列分區排列。搜尋區段標題即可跳轉：

     - :root / Tokens                CSS variables（色彩、字體）
     - Body / Typography             body, h1..h6, a
     - Buttons                       .btn, .btn-primary 等
     - Cards (Apple Style)           .card, .card-img-top
     - Header / Navbar               .navbar, .nav-link, .dropdown-menu
     - Hero Section                  .hero-section, .hero-content
     - Page Banner                   .page-banner（內頁 banner）
     - Breadcrumb                    .breadcrumb-wrapper
     - Sections                      .section-padding, .section-title
     - Sidebar Menu                  .sidebar-menu .list-group-item
     - Pagination                    .pagination, .page-link
     - Form Controls                 .form-control, .form-select
     - Footer                        .footer
     - Misc / Badges                 .badge, .news-card-link, .product-thumb
     - Split Nav                     .nav-item-split, .dropdown-toggle-split
     - Back-to-top                   .back-to-top（footer.php 控制顯示）

   維護注意：
   - 顏色一律使用 :root 內定義的 CSS variable，不直接寫 hex
   - 改 spacing/colors 前先確認影響範圍（grep className）
   - 此檔為正式版（site/juxing），請勿混入 redesign 分支的 token
   ========================================================================== */

/* Apple-inspired Theme */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #ffffff;
    --secondary-color: #0066cc; /* Apple Blue */
    --dark-color: #1e283c;      /* Brand Dark Blue */
    --text-color: #1d1d1f;
    --text-muted: #86868b;
    --light-bg: #f5f5f7;        /* Apple Light Gray Background */
    --border-color: #d2d2d7;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Noto Sans TC", sans-serif;
    font-size: 17px;
    color: var(--text-color);
    background-color: var(--primary-color);
    line-height: 1.47059;
    letter-spacing: -0.022em;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
}

/* Typography Enhancements */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    letter-spacing: -0.015em;
    color: var(--dark-color);
}

a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    text-decoration: underline;
    color: #0077ed;
}

/* Override Bootstrap Shadows */
* {
    box-shadow: none !important;
}

/* Buttons - Pill Shaped */
.btn {
    border-radius: 980px;
    padding: 12px 24px;
    font-size: 17px;
    font-weight: 400;
    letter-spacing: -0.022em;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: #fff;
}

.btn-primary:hover {
    background-color: #0077ed;
    border-color: #0077ed;
    text-decoration: none;
}

.btn-outline-primary {
    color: var(--secondary-color);
    border-color: var(--secondary-color);
    background-color: transparent;
}

.btn-outline-primary:hover {
    background-color: var(--secondary-color);
    color: #fff;
    text-decoration: none;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 16px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 17px;
}

img, .img-fluid {
    border-radius: 10px;
}

.footer-logo, .navbar-brand img {
    border-radius: 0;
}

/* Header & Navbar - Translucent */
.header-top {
    background-color: #ffffff;
    padding: 8px 0;
    font-size: 14px;
    border-bottom: 1px solid var(--light-bg);
}
.header-top a {
    color: var(--text-muted);
    margin-left: 20px;
}
.header-top a:hover {
    color: var(--dark-color);
    text-decoration: none;
}

.navbar {
    background-color: transparent !important;
    padding: 16px 0;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    z-index: 1050 !important;
}
.navbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    z-index: -1;
}
.navbar-brand img {
    height: 60px;
}
.nav-link {
    color: rgba(0, 0, 0, 0.8);
    font-weight: 500;
    font-size: 16px;
    padding: 10px 18px !important;
    letter-spacing: -0.01em;
}
.nav-link:hover, .nav-item.active .nav-link {
    color: #000;
}
.dropdown-menu {
    border: none;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1) !important;
    padding: 10px 0;
    margin-top: 10px;
}
.dropdown-item {
    font-size: 16px;
    padding: 10px 24px;
}
.dropdown-item:hover {
    background-color: var(--light-bg);
    color: var(--secondary-color);
}

/* Hero Section */
.hero-section {
    position: relative;
    background-color: #000;
    color: #fff;
    padding: 60px 0;
    /* 高度加高，讓上方地球多露出，同時保留下方城市天際線 */
    min-height: clamp(520px, 42vw, 780px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background-size: cover;
    /* 定位往上移(60%->45%)，讓上方地球多顯示、減少上方被裁 */
    background-position: center 45%;
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* 新版科技城市主視覺：遮罩再調淡(更亮)，文字落在上方深藍區，配 text-shadow 維持可讀 */
    background: linear-gradient(to bottom, rgba(0,0,0,0.04) 0%, rgba(0,0,0,0.22) 100%);
}
.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}
.hero-section .display-3 {
    font-weight: 600;
    letter-spacing: -0.015em;
    color: #ffffff;
    /* 遮罩調淡後，加陰影確保白字在亮處仍清楚 */
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
}
.hero-section p {
    color: #ffffff;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
}

/* Page Banner */
.page-banner {
    position: relative;
    padding: 100px 0;
    text-align: center;
    color: #ffffff;
    background-size: cover;
    background-position: center;
    background-color: #000000;
}
.page-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(30, 40, 60, 0.7) 100%);
}
.page-banner .container {
    position: relative;
    z-index: 1;
}
.page-banner h1 {
    font-size: 48px;
    font-weight: 600;
    margin-bottom: 0;
    letter-spacing: -0.015em;
    color: #ffffff;
}

/* Breadcrumb */
.breadcrumb-wrapper {
    background-color: #fff;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 60px;
}
.breadcrumb {
    margin-bottom: 0;
    background: transparent;
    padding: 0;
    font-size: 12px;
}
.breadcrumb-item a {
    color: var(--text-muted);
}
.breadcrumb-item.active {
    color: var(--dark-color);
}

/* Sections */
.section-padding {
    padding: 100px 0;
}
.section-title {
    font-size: 40px;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 50px;
    letter-spacing: -0.015em;
    text-align: center;
}

/* Cards (Apple Style) */
.card {
    border: none;
    border-radius: 10px;
    background-color: #ffffff;
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    overflow: hidden;
}
.bg-light .card {
    background-color: #ffffff;
}
.bg-white .card {
    background-color: var(--light-bg);
}
.card:hover {
    transform: scale(1.02);
}
.card-img-top {
    border-radius: 10px 10px 0 0;
}

/* Footer */
.footer {
    background-color: var(--light-bg);
    color: var(--text-color);
    padding: 40px 0 20px;
    border-top: 1px solid var(--border-color);
}
.footer h4, .footer h5 {
    color: var(--dark-color);
    font-weight: 600;
    font-size: 18px;
}
.footer p, .footer li {
    font-size: 16px;
    color: var(--text-color);
}
.footer a {
    color: var(--text-muted);
}
.footer a:hover {
    color: var(--dark-color);
    text-decoration: underline;
}
.footer-info {
    list-style: none;
    padding: 0;
}
.footer-info li {
    margin-bottom: 8px;
    display: flex;
    align-items: flex-start;
}
.footer-info li i {
    margin-top: 3px;
    margin-right: 10px;
}
.footer-bottom {
    border-top: 1px solid var(--border-color);
    margin-top: 20px;
    padding-top: 15px;
    font-size: 12px;
    color: var(--text-muted);
}

/* Sidebar Menu */
.sidebar-menu .list-group-item {
    border: none;
    border-radius: 12px !important;
    margin-bottom: 5px;
    padding: 12px 20px;
    color: var(--dark-color);
    font-weight: 400;
    background-color: transparent;
    transition: background-color 0.2s ease;
}
.sidebar-menu .list-group-item:hover {
    background-color: var(--light-bg);
    text-decoration: none;
}
.sidebar-menu .list-group-item.active {
    background-color: var(--dark-color);
    color: #ffffff;
}

/* Pagination */
.pagination {
    gap: 8px;
}
.pagination .page-link {
    color: var(--dark-color);
    border: none;
    border-radius: 50% !important;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--light-bg);
    font-weight: 500;
}
.pagination .page-link:hover {
    background-color: var(--border-color);
    text-decoration: none;
}
.pagination .page-item.active .page-link {
    background-color: var(--dark-color);
    color: #ffffff;
}

/* Form Controls */
.form-control, .form-select {
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 14px 18px;
    background-color: var(--light-bg);
    font-size: 17px;
}
.form-control:focus, .form-select:focus {
    border-color: var(--secondary-color);
    background-color: #ffffff;
    outline: none;
    box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.1) !important;
}

/* Badges */
.badge {
    border-radius: 980px;
    font-weight: 500;
    padding: 6px 12px;
}

/* Split nav item: main label clickable, separate caret toggles dropdown */
.nav-item-split {
    display: flex;
    align-items: center;
}
.nav-item-split > .nav-link {
    padding-right: 4px !important;
}
.nav-item-split > .dropdown-toggle-split {
    padding-left: 4px !important;
    padding-right: 10px !important;
}
.nav-item-split > .dropdown-toggle-split::after {
    margin-left: 0;
}
@media (max-width: 991.98px) {
    .nav-item-split {
        flex-wrap: wrap;
    }
    .nav-item-split > .nav-link {
        flex: 1 1 auto;
    }
}

/* News card hover affordance on home page */
.news-card-link {
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.news-card-link:hover {
    transform: translateY(-3px);
}
a:has(> .news-card-link):hover {
    text-decoration: none;
}

/* Product card thumbnail — uniform crop regardless of source aspect ratio */
.product-thumb {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background-color: var(--light-bg);
    border-radius: 10px;
}
.product-card {
    overflow: hidden;
}
.product-card .product-thumb {
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.product-card:hover .product-thumb {
    transform: scale(1.03);
}

/* Back to top floating button */
.back-to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 48px;
    height: 48px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18) !important;
}
.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top:hover {
    transform: translateY(-2px);
}

/* ─── 電子料件介紹區塊 ─── */
/*
 * 字級規範（不要隨意調小，標題與內文必須維持明顯層級差）：
 *   ┌─────────────┬──────────┬──────────┬───────────────────┐
 *   │ 元素        │ 桌機 px  │ 手機 px  │ 行高              │
 *   ├─────────────┼──────────┼──────────┼───────────────────┤
 *   │ 標題 h3     │   36 px  │   28 px  │ 1.4               │
 *   │ 內文 p      │   24 px  │   18 px  │ 2                 │
 *   │ strong 重點 │ 同內文   │ 同內文   │ —                 │
 *   └─────────────┴──────────┴──────────┴───────────────────┘
 * 排版原則：
 *   - 內文要大、要清楚（最小 18px，桌機 24px）
 *   - 標題比內文大 1.5×，視覺層級必須一眼分得出來
 *   - strong 用黑底線而非變色，保持單色科技風
 *   - 下方 1px 灰線分隔，不要加圓角／陰影／漸層
 */
.parts-intro {
    padding: 0 0 2rem;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid #e5e7eb;
}
.parts-intro h3 {
    color: #111;
    font-size: 36px;
    line-height: 1.4;
    font-weight: 700;
    margin-bottom: 1.5rem;
    letter-spacing: 0.04em;
}
.parts-intro-text {
    font-size: 24px;
    line-height: 2;
    color: #222;
    margin: 0;
    letter-spacing: 0.02em;
}
.parts-intro-text strong {
    color: #111;
    font-weight: 700;
    border-bottom: 1px solid #111;
    padding-bottom: 1px;
}
@media (max-width: 576px) {
    .parts-intro h3 { font-size: 28px; }
    .parts-intro-text {
        font-size: 18px;
        line-height: 1.9;
    }
    .parts-intro-text br { display: none; }
}
