:root {
    --bg-color: #0a0a0a;
    --bg-light: #1a1a1a;
    --bg-lighter: #252525;
    --text-main: #ffffff;
    --text-muted: #b0b0b0;
    --primary-red: #e60012;
    --border-color: #333333;
    --container-width: 1200px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: "PingFang TC", "Heiti TC", "微軟正黑體", sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

.text-center { text-align: center; }

.btn-primary {
    display: inline-block;
    background-color: var(--primary-red);
    color: white;
    padding: 12px 40px;
    border-radius: 30px;
    font-weight: bold;
    font-size: 1.1rem;
}

.btn-secondary {
    display: inline-block;
    background-color: white;
    color: #1a1a1a;
    padding: 12px 40px;
    border-radius: 30px;
    font-weight: bold;
    font-size: 1.1rem;
}

.card-hover {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card-hover:hover {
    transform: translateY(-3px);
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.12) !important;
}

/* 紅框標籤：雙邊框效果 */
.section-label {
    display: inline-block;
    border: 0px solid var(--primary-red);
    color: #ffffff;
    padding: 6px 28px;
    font-weight: bold;
    font-size: 1.05rem;
    margin-bottom: 28px;
    position: relative;
    letter-spacing: 0.2rem;
}
.section-label::before {
    content: "";
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border: 0px solid var(--primary-red);
    pointer-events: none;
}

.main-header { background-color: var(--bg-color); border-bottom: 0px solid var(--border-color); letter-spacing: 0.2rem; }
.top-bar { padding: 6px 0; }
.top-bar .container { display: flex; justify-content: flex-end; }
.lang-selector { display: inline-flex; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--text-muted); }
.lang-icon { height: 20px; width: auto; }
.lang-select { background: transparent; border: 1px solid var(--border-color); border-radius: 4px; color: var(--text-muted); font-size: 1.0rem; padding: 2px 6px; cursor: pointer; outline: none; appearance: none; -webkit-appearance: none; }
.lang-select:hover { color: #ffffff; border-color: #555; }
.lang-select option { background-color: #151515; color: #ffffff; }
.logo-container { text-align: center; padding: 25px 20px; border-bottom: 1px solid #ffffff; }
.logo { max-height: 110px; margin: 0 auto; }
.main-nav ul { display: flex; justify-content: center; flex-wrap: wrap; }
.main-nav li { flex: 0 1 auto; position: relative; }
.main-nav .has-dropdown { display: flex; align-items: stretch; }
.main-nav .has-dropdown > a { flex: 1; padding-right: 0; }
.main-nav a { display: block; padding: 20px 40px; font-size: 1.2rem; color: #e0e0e0; cursor: pointer; }
.main-nav a:hover { color: #ffffff; font-weight: bold; }

.main-nav .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 180px;
    background-color: #151515;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: block;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 200;
    text-align: center;
}
@media (hover: hover) and (pointer: fine) {
    .main-nav .has-dropdown:hover .dropdown-menu {
        opacity: 1;
        visibility: visible;
    }
}
.main-nav .has-dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
}
.main-nav .dropdown-menu li { flex: none; width: 100%; }
.main-nav .dropdown-menu a {
    padding: 12px 20px;
    font-size: 1.2rem;
    border-bottom: 1px solid var(--border-color);
}
.main-nav .dropdown-menu li:last-child a { border-bottom: none; }

.nav-hamburger { display: none; flex-direction: column; justify-content: center; gap: 5px; background: none; border: none; cursor: pointer; padding: 8px; flex-shrink: 0; }
.nav-hamburger span { display: block; width: 24px; height: 2px; background-color: #e0e0e0; border-radius: 2px; transition: transform 0.25s, opacity 0.25s; }
.nav-hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.dropdown-arrow { display: inline-flex; align-items: center; background: none; border: none; cursor: pointer; padding: 0 14px 0 4px; color: #ffffff; font-size: 1.0rem; flex-shrink: 0; }
.dropdown-arrow::after { content: '▾'; display: block; transition: transform 0.2s; }
.has-dropdown.open > .dropdown-arrow::after { transform: rotate(180deg); }


.main-footer { background-color: #050505; border-top: 0px solid #222; padding: 50px 0 20px; letter-spacing: 0.2rem; }
.footer-content { display: flex; align-items: stretch; padding-bottom: 0px 0px 30px 0px; }
.footer-logo { flex: 1; padding: 0 40px; display: flex; align-items: center; justify-content: center; }
.footer-logo img { max-width: 260px; }
.footer-contact { flex: 1; min-width: 0; padding: 40px 0px; border-right: 1px solid rgba(255,255,255, 1); display: flex; flex-direction: column; justify-content: center; }
.footer-contact-row { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.footer-contact-row:last-child { margin-bottom: 0; }
.footer-contact-row p { margin: 0; color: #ffffff; font-size: 1rem; line-height: 1.6; overflow-wrap: break-word; word-break: break-word; }
.footer-contact .indent { padding-left: 0; color: #ffffff; font-size: 0.88rem; margin-top: 4px; }
.footer-icon { width: 20px; height: 20px; flex-shrink: 0; margin-top: 2px; opacity: 1; }
.footer-certs { flex: 1; padding: 0 40px; display: flex; flex-direction: column; justify-content: center; }
.cert-logos-small { display: flex; gap: 20px; margin-bottom: 16px; }
.cert-logos-small img { height: 40px; filter: grayscale(100%) brightness(200%); }
.cert-list { padding: 0; margin: 0; }
.cert-list li { color: #ffffff; font-size: 0.95rem; line-height: 1.8; margin-bottom: 4px; }
.footer-bottom { padding: 18px 0; text-align: center; }
.footer-bottom p { margin: 0; color: #888; font-size: 0.9rem; }

@media (max-width: 900px) {
    .logo-container { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; text-align: left; }
    .logo { max-height: 60px; }
    .nav-hamburger { display: flex; }
    .dropdown-arrow { padding: 0 16px; font-size: 0.8rem; color: #e0e0e0; }

    .main-nav { display: none; border-top: 1px solid var(--border-color); }
    .main-nav.nav-open { display: block; }
    .main-nav ul { flex-direction: column; }
    .main-nav > ul > li { flex: none; width: 100%; border-bottom: 1px solid var(--border-color); }
    .main-nav > ul > li:last-child { border-bottom: none; }
    .main-nav > ul > li > a { padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; }
    .main-nav > ul > li.has-dropdown { display: flex; align-items: center; flex-wrap: wrap; }
    .main-nav > ul > li.has-dropdown > a { flex: 1; }

    .main-nav .dropdown-menu { position: static !important; opacity: 1 !important; visibility: visible !important; transform: none !important; transition: none !important; width: 100%; box-shadow: none; background-color: var(--bg-light); border: none; border-top: 1px solid var(--border-color); display: none; }
    .main-nav .has-dropdown:hover .dropdown-menu { display: none !important; }
    .main-nav .has-dropdown.open .dropdown-menu { display: block !important; flex-basis: 100%; }
    .main-nav .dropdown-menu a { padding: 12px 20px 12px 36px; font-size: 0.9rem; }
}


/* ── CMS Shared Partials ── */
.sec-hero { position: relative; height: 70vh; min-height: 440px; display: flex; align-items: center; justify-content: center; text-align: center; overflow: hidden; }
.sec-hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; opacity: 0.4; }
.sec-hero-overlay { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(10,10,10,0.2) 0%, rgba(10,10,10,0.65) 100%); z-index: 2; }
.sec-hero-content { position: relative; z-index: 3; padding: 0 20px; }
.sec-hero-content h1 { font-size: 3.0rem; font-weight: bold; letter-spacing: 0.2rem; line-height: 1.3; margin-bottom: 32px; text-shadow: 0 4px 12px rgba(0,0,0,0.8); }
.sec-hero-content p { font-size: 1.05rem; color: rgba(255,255,255,0.8); max-width: 620px; margin: 0 auto 36px; line-height: 1.8; }

.sec-chevron { text-align: center; line-height: 0; }
.chevron-label { display: inline-block; min-width: min(740px, 90vw); text-align: center; white-space: pre-line; background-image: url('/images/home/1-1.png'); background-size: 100% 100%; background-repeat: no-repeat; padding: 40px 35px 45px 35px; color: #ffffff; font-weight: bold; font-size: 2.1rem; letter-spacing: 0.2rem; line-height: 1.5; }

.link-more { /*color: var(--primary-red);*/ }

.sec-cta { padding: 100px 20px; color: white; text-align: center; }
.sec-cta h2 { font-size: 3.0rem; margin-bottom: 20px; }
.sec-cta h3 { font-size: 2.0rem; margin-bottom: 20px; }
.sec-cta p { font-size: 1.5rem; opacity: 0.95; margin-bottom: 40px; }

.sec-icon-strip { background-color: var(--bg-light); border-bottom: 1px solid var(--border-color); padding-bottom: 80px; }
.sec-cert-row { display: flex; justify-content: center; align-items: center; gap: 50px; flex-wrap: wrap; padding: 40px 20px 0; }
.sec-cert-row img:first-child { height: 60px; }
.sec-cert-row img { height: 110px; filter: grayscale(100%) brightness(200%); }
.sec-strip-title { font-size: 3.0rem; font-weight: bold; text-align: center; padding: 40px 20px 0; }
.sec-icon-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 30px; padding: 40px 20px 0; max-width: 1400px; margin: 0 auto; }
.sec-icon-item { flex: 1 1 200px; max-width: 240px; text-align: center; }
.sec-icon-item p { font-size: 1.15rem; font-weight: 500; margin-bottom: 16px; }
.sec-icon-item img { width: 150px; height: 150px; object-fit: contain; margin: 0 auto; }

.sec-gallery { background: linear-gradient(to bottom, rgba(10,10,10,1) 0%, rgba(30,30,30,1) 100%); padding: 0px 0px 100px 0px; }
.sec-gallery-intro { text-align: center; padding: 40px 20px 0; /*max-width: 1100px;*/ margin: 0 auto; margin-bottom: 40px; }
.sec-gallery-intro h2 { font-size: 3.0rem; font-weight: bold; line-height: 1.35; margin-bottom: 20px; }
.sec-gallery-intro p { font-size: 1.1rem; color: var(--text-muted); line-height: 1.8; margin-bottom: 0px; }
.sec-gallery-title { font-size: 2.4rem; font-weight: bold; text-align: center; padding: 40px 20px 0; }
.sec-gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.sec-gallery-grid img { width: 100%; height: 420px; object-fit: cover; display: block; }
.sec-gallery-scroll { display: flex; overflow-x: auto; gap: 30px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.sec-gallery-scroll img { flex: 0 0 33.333%; max-width: 33.333%; height: 420px; object-fit: cover; scroll-snap-align: start; }

.sec-cards { background-color: var(--bg-light); border-top: 1px solid var(--border-color); }
.sec-cards-header { text-align: center; padding: 40px 20px 0; }
.sec-cards-header h2 { font-size: 3.0rem; font-weight: bold; margin-bottom: 14px; }
.sec-cards-header p { color: var(--text-muted); font-size: 1rem; }
.sec-cards-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 30px; max-width: 1200px; margin: 36px auto 0; padding: 0 0px 80px; }
.sec-card { background-color: #241E1E; border: 1px solid #745F5F; border-radius: 20px; padding: 32px 32px 96px; position: relative; }
.sec-card.full-width { grid-column: 1 / -1; }
.sec-card-icon { width: 150px; height: 150px; object-fit: contain; display: block; margin-bottom: 20px; }
.sec-card-title { color: #DBDBDB; font-size: 2.0rem; font-weight: bold; margin-bottom: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sec-card-title-badge { height: 50px; width: auto; flex-shrink: 0; }
.sec-card-body { display: none; margin-top: 20px; padding-top: 20px; border-top: 1px solid #745F5F; color: #FFFFFF; font-size: 1.4rem; line-height: 1.8; }
.sec-card.expanded .sec-card-body { display: block; }
.sec-card-toggle { display: block; position: absolute; bottom: 24px; right: 24px; width: 56px; height: 56px; background-color: rgba(68,68,68,1); border-radius: 50%; cursor: pointer; user-select: none; }
.sec-card-toggle::before, .sec-card-toggle::after { content: ''; position: absolute; top: 50%; left: 50%; width: 26px; height: 4px; background-color: rgba(18,18,18,1); border-radius: 1px; transition: transform 0.25s; }
.sec-card-toggle::before { transform: translate(-50%, -50%); }
.sec-card-toggle::after { transform: translate(-50%, -50%) rotate(90deg); }
.sec-card.expanded .sec-card-toggle::before { transform: translate(-50%, -50%) rotate(45deg); }
.sec-card.expanded .sec-card-toggle::after { transform: translate(-50%, -50%) rotate(135deg); }

.cms-text-block { }
.cms-feature-row { padding: 60px 20px; background-color: var(--bg-light); border-top: 1px solid var(--border-color); }
.cms-feature-rows { display: flex; flex-direction: column; gap: 32px; max-width: 1100px; margin: 0 auto; }
.cms-feature-row-item { display: flex; align-items: flex-start; gap: 20px; }
.cms-feature-icon { width: 64px; height: 64px; object-fit: contain; flex-shrink: 0; }
.cms-feature-row-text h4 { font-size: 1.2rem; font-weight: bold; margin-bottom: 8px; }
.cms-feature-row-text p { color: var(--text-muted); font-size: 1rem; line-height: 1.8; }

@media (max-width: 1024px) {
    .sec-gallery-grid img { height: 280px; }
    .sec-gallery-scroll img { flex: 0 0 50%; max-width: 50%; height: 280px; }
}
@media (max-width: 900px) {
    .sec-cards-grid { grid-template-columns: 1fr; padding: 0px 10px; }
    .sec-card.full-width { grid-column: auto; }
    .chevron-label { padding: 20px 35px 70px 35px;}
    .sec-chevron { padding: 0px 10px 0px 10px; }
}
@media (max-width: 768px) {
    .sec-hero-content h1 { font-size: 2rem; letter-spacing: 0.2rem; }
    .sec-gallery-intro h2 { font-size: 2rem; }
    .sec-gallery-grid { grid-template-columns: 1fr !important; }
    .sec-gallery-grid img { height: 260px; }
    .sec-gallery-title { font-size: 1.9rem; }
    .sec-gallery-scroll img { flex: 0 0 100%; max-width: 100%; }
}
@media (max-width: 576px) {
    .sec-icon-grid { gap: 20px; }
    .sec-icon-item { flex: 1 1 130px; }
    .sec-icon-item img { width: 100px; height: 100px; }
}

@media (max-width: 900px) {
    .footer-content { flex-direction: column; }
    .footer-logo { padding: 30px 24px 20px; justify-content: flex-start; border-bottom: 0px solid rgba(255,255,255,0.15); }
    .footer-logo img { max-width: 200px; }
    .footer-contact { flex: none; padding: 24px; border-right: none; border-bottom: 1px solid rgba(255,255,255, 1); }
    .footer-certs { flex: none; padding: 24px; }
    .cert-logos-small { gap: 16px; }
    .cert-logos-small img { height: 44px; }
}

.back-to-top { position: fixed; bottom: 32px; right: 32px; width: 48px; height: 48px; border-radius: 50%; background: rgba(36,30,30,0.9); border: 1px solid rgba(255,255,255,0.2); color: rgba(255,255,255,0.8); cursor: pointer; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s, background 0.2s, color 0.2s, transform 0.2s; z-index: 999; backdrop-filter: blur(4px); }
.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover { background: var(--primary-red); border-color: var(--primary-red); color: #fff; transform: translateY(-3px); }
@media (max-width: 768px) { .back-to-top { bottom: 20px; right: 20px; width: 42px; height: 42px; } }
