/* 子頁共用樣式：news / works / ai / exhibition
   首頁 index.html 不使用本檔——其 header 浮在 3D banner 上，結構與子頁的深色 sticky header 不同。
   全螢幕的 exhibition-demo.html 亦不使用本檔。
   各頁在自己的 <style> 覆寫差異，載入順序為 common.css 在前。 */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;700&family=Orbitron:wght@400;700&display=swap');

:root {
    --primary-lime: #B4D333;
    --tech-blue: #00A0E9;
    --bg-dark: #050F27;
    --text-grey: #666;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', system-ui, -apple-system, sans-serif;
    background: #fff;
    color: #222;
    overflow-x: hidden;
}

/* 全站標題採平衡換行，避免末行只剩單一中文字或標點。 */
:where(h1, h2, h3) {
    text-wrap: balance;
}

/* ---------- 頁首 ---------- */
.page-header {
    background: var(--bg-dark);
    position: sticky;
    top: 0;
    z-index: 80;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 88px;
    padding: 18px 5%;
    transition: 0.3s;
}

.logo {
    height: 50px;
    flex: 0 0 auto;
}

.logo img {
    height: 100%;
    width: auto;
    display: block;
}

nav {
    display: flex;
    gap: 30px;
    align-items: center;
}

nav a {
    color: white;
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: bold;
    transition: 0.3s;
}

nav a:hover,
nav a.is-current {
    color: var(--primary-lime);
}

.page-header nav a.btn-contact {
    padding: 9px 20px;
    border-radius: 5px;
    background: var(--primary-lime);
    color: #050F27;
    box-shadow: 0 7px 22px rgba(180, 211, 51, 0.14);
}

.page-header nav a.btn-contact:hover,
.page-header nav a.btn-contact.is-current {
    background: #a7c62b;
    color: #050F27;
    transform: translateY(-1px);
}

.menu-toggle {
    display: none;
    width: 30px;
    height: 20px;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    z-index: 100;
    appearance: none;
    padding: 0;
    border: 0;
    background: transparent;
}

.menu-toggle span {
    display: block;
    height: 3px;
    width: 100%;
    background: #fff;
    transition: 0.3s;
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(8.5px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-8.5px) rotate(-45deg);
}

.mobile-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background: rgba(5, 15, 39, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* 8 項在橫向手機會超出 100vh；safe center 讓超出時不裁切頂端，舊瀏覽器沿用上一行 */
    justify-content: safe center;
    overflow-y: auto;
    padding: 24px 0;
    gap: 30px;
    transition: 0.5s;
    z-index: 90;
    visibility: hidden;
}

.mobile-nav.active {
    right: 0;
    visibility: visible;
}

.mobile-nav a {
    color: white;
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: bold;
}

.mobile-nav .btn-contact {
    min-width: 148px;
    padding: 11px 24px;
    border-radius: 5px;
    background: var(--primary-lime);
    color: #050F27;
    text-align: center;
}

.mobile-nav-open {
    overflow: hidden;
}

.mobile-close {
    position: absolute;
    top: 24px;
    right: 5%;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.5rem;
    line-height: 1;
    cursor: pointer;
}

nav a:focus-visible,
.menu-toggle:focus-visible,
.mobile-nav a:focus-visible,
.mobile-close:focus-visible,
.cta-btn:focus-visible,
.float-btn:focus-visible {
    outline: 3px solid rgba(180, 211, 51, 0.8);
    outline-offset: 4px;
}

/* ---------- 頁面標題 ---------- */
.page-hero {
    background: var(--bg-dark);
    color: #fff;
    padding: 60px 5% 90px;
    position: relative;
    overflow: hidden;
}

.page-hero-en {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(2rem, 6vw, 4rem);
    font-weight: 700;
    line-height: 1;
    color: rgba(255, 255, 255, 0.08);
    letter-spacing: 2px;
}

.page-hero-zh {
    font-size: clamp(1.875rem, 4.1vw, 3.5rem);
    font-weight: 700;
    line-height: 1.14;
    letter-spacing: -0.035em;
    margin-top: -0.4em;
}

.page-hero-zh::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--primary-lime);
    margin-top: 20px;
}

.page-hero-lead {
    margin-top: 24px;
    max-width: 640px;
    line-height: 1.9;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.9375rem;
}

.breadcrumb {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 24px;
}

.breadcrumb a {
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--primary-lime);
}

/* ---------- 內容區塊 ---------- */
.section {
    max-width: 1140px;
    margin: 0 auto;
    padding: 80px 5%;
}

.section-title {
    font-size: clamp(1.375rem, 3vw, 1.875rem);
    font-weight: 700;
}

.section-title::after {
    content: '';
    display: block;
    width: 44px;
    height: 4px;
    background: var(--primary-lime);
    margin-top: 16px;
}

.section-lead {
    color: var(--text-grey);
    line-height: 1.9;
    font-size: 0.9375rem;
    margin-top: 20px;
    max-width: 720px;
}

/* ---------- 捲動現身 ---------- */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- 按鈕 ---------- */
.cta-btn {
    display: inline-block;
    background: var(--primary-lime);
    color: #000;
    font-weight: 700;
    text-decoration: none;
    padding: 14px 40px;
    border-radius: 5px;
    transition: 0.3s;
}

.cta-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(180, 211, 51, 0.4);
}

.cta-btn.ghost {
    background: none;
    border: 1px solid var(--bg-dark);
    color: var(--bg-dark);
}

.cta-btn.ghost:hover {
    background: var(--bg-dark);
    color: #fff;
    box-shadow: none;
}

/* ---------- 頁尾 ---------- */
.site-footer {
    background-color: #0F1628;
    color: rgba(255, 255, 255, 0.7);
    padding: 60px 5% 0;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    justify-content: space-between;
    padding-bottom: 40px;
}

.footer-left {
    flex: 1 1 420px;
}

.footer-branding {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.footer-logo {
    height: 34px;
}

.company-title {
    color: #fff;
    font-weight: 700;
}

.footer-desc {
    font-size: 0.875rem;
    line-height: 1.9;
    max-width: 520px;
}

.footer-right {
    flex: 0 1 320px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.info-row {
    font-size: 0.875rem;
    margin-bottom: 8px;
}

.info-row a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
}

.info-row a:hover {
    color: var(--primary-lime);
}

.footer-socials a {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.125rem;
    margin-top: 8px;
    display: inline-block;
}

.footer-socials a:hover {
    color: var(--primary-lime);
}

.footer-iso img {
    height: 46px;
}

.copyright-bar {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    font-size: 0.75rem;
    padding: 20px 0;
    color: rgba(255, 255, 255, 0.45);
}

/* 頁尾法遵連結：誠信治理專區為對外公開揭露義務，全站常設入口 */
.footer-legal-link {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    margin-right: 14px;
    padding-right: 14px;
    border-right: 1px solid rgba(255, 255, 255, 0.18);
}

.footer-legal-link:hover {
    color: var(--primary-lime);
}

@media (max-width: 600px) {
    .footer-legal-link {
        display: block;
        margin: 0 0 8px;
        padding: 0;
        border-right: 0;
    }
}

/* ---------- 浮動側欄 ---------- */
.floating-sidebar {
    position: fixed;
    right: 20px;
    bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 70;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s;
}

.floating-sidebar.active {
    opacity: 1;
    pointer-events: auto;
}

.float-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: 0.3s;
}

.float-btn:hover {
    background: var(--primary-lime);
    color: #000;
}

.page-top-text {
    font-size: 0.5625rem;
    color: var(--text-grey);
    letter-spacing: 1px;
}

/* ---------- 響應式 ---------- */
@media (max-width: 1024px) {
    /* 導覽列 8 項約需 640px，加 logo 後低於 1024px 會與 logo 相撞 */
    nav {
        display: none;
    }

    .menu-toggle {
        display: flex;
    }
}

@media (max-width: 768px) {
    header {
        min-height: 72px;
        padding-top: 13px;
        padding-bottom: 13px;
    }

    .logo {
        height: 44px;
    }

    .page-hero {
        padding: 40px 5% 60px;
    }

    .section {
        padding: 50px 5%;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }

    .reveal-on-scroll {
        opacity: 1;
        transform: none;
    }
}
