/* =======================================================
   QUAN International — Shared Stylesheet
   包含：CSS 變數、基礎重置、Header、漢堡選單、
         Footer、懸浮按鈕、通用 RWD
   ======================================================= */

/* ── CSS 變數 ────────────────────────────────────────── */
:root {
    --bg-color:      #080808;
    --bg-secondary:  #111111;
    --primary:       #2563eb;
    --accent:        #00d4aa;
    --text-main:     #ffffff;
    --text-muted:    #888888;
    --border-color:  #222222;
    --nav-height:    80px;
    --transition:    all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* ── 基礎重置 ─────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { overflow-x: hidden; max-width: 100%; }

body {
    font-family: 'Noto Sans TC', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

a { text-decoration: none; color: inherit; transition: var(--transition); }
ul { list-style: none; }
img { max-width: 100%; display: block; }

.container { max-width: 1200px; margin: 0 auto; }

/* ── 自定義捲軸 ───────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-color); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ======================================================
   Header & 桌機導覽列
   ====================================================== */
header {
    position: fixed; top: 0; left: 0; width: 100%; height: var(--nav-height);
    background: rgba(8, 8, 8, 0.85); backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    z-index: 1000; transition: 0.3s;
}
.header-container {
    max-width: 1400px; margin: 0 auto; height: 100%;
    display: flex; align-items: center; justify-content: space-between; padding: 0 2rem;
}
.logo {
    font-family: 'Orbitron', sans-serif; font-size: 1.2rem; font-weight: 700;
    color: white; display: flex; align-items: center; gap: 8px;
}
.logo img { height: 32px; width: auto; }
.logo span { color: var(--primary); }

.nav-links { display: flex; gap: 1.5rem; height: 100%; }
.nav-item { position: relative; height: 100%; display: flex; align-items: center; }
.nav-link {
    font-size: 0.95rem; font-weight: 500; color: #ccc;
    cursor: pointer; padding: 0 10px;
    position: relative; white-space: nowrap;
}
.nav-link::after {
    content: ''; position: absolute; bottom: 25px; left: 10px;
    width: 0; height: 2px; background: var(--primary); transition: 0.3s;
}
.nav-item:hover .nav-link { color: white; }
.nav-item:hover .nav-link::after { width: calc(100% - 20px); }

/* Mega Menu */
.mega-menu {
    position: fixed; top: var(--nav-height); left: 0; width: 100%;
    background: #0f0f0f; border-bottom: 1px solid #333; padding: 3rem 0;
    opacity: 0; visibility: hidden; transform: translateY(-20px);
    transition: var(--transition); box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}
.nav-item:hover .mega-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.mega-grid {
    max-width: 1400px; margin: 0 auto;
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; padding: 0 2rem;
}
.mega-col h3 {
    color: var(--primary); margin-bottom: 1rem; font-size: 1.1rem;
    border-left: 3px solid var(--primary); padding-left: 10px;
    display: flex; align-items: center; gap: 8px;
}
.mega-col a { display: block; color: #999; padding: 6px 0; font-size: 0.95rem; }
.mega-col a:hover { color: white; transform: translateX(5px); }

/* Dropdown (一般下拉) */
.dropdown-menu {
    position: absolute; top: 100%; left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: #151515; min-width: 200px; border: 1px solid #333; border-radius: 8px;
    padding: 1rem 0; opacity: 0; visibility: hidden; transition: 0.3s;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.nav-item:hover .dropdown-menu { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }
.dropdown-item {
    display: block; padding: 0.8rem 1.5rem; color: #ccc; font-size: 0.9rem;
    border-bottom: 1px solid rgba(255,255,255,0.05); white-space: nowrap;
}
.dropdown-item:last-child { border-bottom: none; }
.dropdown-item:hover { background: #222; color: var(--primary); padding-left: 2rem; }
.dropdown-item i { margin-right: 10px; width: 20px; text-align: center; }

/* Header 右側工具列 */
.header-tools { display: flex; align-items: center; gap: 1.5rem; }
.lang-btn {
    border: 1px solid #444; padding: 4px 12px;
    border-radius: 20px; font-size: 0.8rem; color: #aaa; cursor: pointer;
}
.lang-btn:hover { border-color: var(--primary); color: white; }

/* ======================================================
   漢堡選單按鈕（手機版）
   ====================================================== */
.hamburger {
    display: none;
    flex-direction: column; justify-content: space-between;
    width: 28px; height: 20px;
    cursor: pointer; background: none; border: none; padding: 0;
}
.hamburger span {
    display: block; width: 100%; height: 2px;
    background: #ccc; border-radius: 2px;
    transition: all 0.35s cubic-bezier(0.165, 0.84, 0.44, 1);
    transform-origin: center;
}
.hamburger.active span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* ======================================================
   手機側拉選單
   ====================================================== */
.mobile-nav {
    position: fixed; top: var(--nav-height); left: 0; width: 100%;
    height: calc(100vh - var(--nav-height));
    background: #0a0a0a;
    transform: translateX(-100%);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 999; overflow-y: auto;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.mobile-nav.open { transform: translateX(0); }

.mobile-nav-list { padding: 0.5rem 0; }
.mobile-nav-item { border-bottom: 1px solid rgba(255,255,255,0.05); }

.mobile-nav-top {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem 2rem;
}
.mobile-nav-top > a { color: #ccc; font-size: 1rem; font-weight: 500; flex: 1; }
.mobile-nav-top:hover > a { color: white; }

.mobile-nav-toggle {
    background: none; border: none; color: #666;
    font-size: 0.75rem; cursor: pointer; padding: 4px 8px;
    transition: transform 0.3s, color 0.3s;
}
.mobile-nav-top.open .mobile-nav-toggle { transform: rotate(180deg); color: var(--primary); }

.mobile-sub-section { display: none; padding: 0 2rem 1.2rem 2rem; }
.mobile-sub-section.open { display: block; }
.mobile-sub-section h4 {
    color: var(--primary); font-size: 0.8rem; text-transform: uppercase;
    letter-spacing: 1px; margin: 0.8rem 0 0.4rem;
}
.mobile-sub-section a {
    display: block; color: #888; padding: 0.45rem 0.5rem;
    font-size: 0.9rem;
}
.mobile-sub-section a:hover { color: white; }

/* 手機版「聯絡我們」按鈕 */
.mobile-contact-btn {
    display: block; margin: 1.5rem 2rem;
    text-align: center; padding: 0.75rem;
    border: 1px solid var(--primary); border-radius: 30px;
    color: var(--primary); font-weight: 500;
}
.mobile-contact-btn:hover { background: var(--primary); color: white; }

/* Header 網站地圖文字按鈕 */
.nav-sitemap-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border-radius: 6px;
    border: 1px solid rgba(37,99,235,0.35);
    background: rgba(37,99,235,0.07);
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.2s;
}
.nav-sitemap-btn i { font-size: 0.8rem; }
.nav-sitemap-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    transform: translateY(-1px);
}

/* ======================================================
   Footer — 全新設計
   ====================================================== */

/* 頂部品牌區 */
footer {
    background: #060608;
    border-top: 1px solid #111;
    font-size: 0.9rem;
}
.footer-accent-bar {
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary) 30%, var(--accent) 70%, transparent);
}
.footer-top {
    padding: 3.5rem 2rem 2.5rem;
    border-bottom: 1px solid #161616;
}
.footer-top-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 3rem;
}
.footer-logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.4rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    margin-bottom: 0.8rem;
    text-decoration: none;
}
.footer-logo img { height: 34px; width: auto; }
.footer-tagline {
    color: var(--primary);
    font-size: 0.85rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 1rem;
}
.footer-contact-info {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
    margin-bottom: 1.4rem;
}
.footer-contact-info a {
    color: #777;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: 0.3s;
    text-decoration: none;
}
.footer-contact-info a i { color: var(--primary); font-size: 0.8rem; }
.footer-contact-info a:hover { color: white; }
.footer-address {
    color: #555;
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 0;
}
.footer-address i { color: var(--primary); }

/* 社群圖示 */
.footer-social {
    display: flex;
    gap: 0.7rem;
}
.footer-social a {
    width: 38px; height: 38px;
    border-radius: 50%;
    border: 1px solid #2a2a2a;
    background: #0d0d0d;
    display: flex; align-items: center; justify-content: center;
    color: #666;
    font-size: 0.95rem;
    transition: 0.3s;
    text-decoration: none;
}
.footer-social a:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 0 16px rgba(37,99,235,0.5);
}

/* 導覽連結區 */
.footer-nav {
    padding: 3rem 2rem;
    border-bottom: 1px solid #111;
}
.footer-nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3rem;
}
.footer-col h4 {
    color: white;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 1.2rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid #1e1e1e;
    display: flex;
    align-items: center;
    gap: 7px;
}
.footer-col h4 i { color: var(--primary); font-size: 0.85rem; }
.footer-col h4.footer-subhead {
    margin-top: 1.8rem;
    font-size: 0.75rem;
}
.footer-col a {
    display: block;
    color: #5a5a6a;
    margin-bottom: 0.6rem;
    font-size: 0.85rem;
    transition: 0.25s;
    text-decoration: none;
    line-height: 1.5;
}
.footer-col a:hover {
    color: var(--primary);
    padding-left: 6px;
}

/* Google Maps 區塊 */
.footer-map-block {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}
.footer-map-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: white;
    display: flex;
    align-items: center;
    gap: 6px;
}
.footer-map-label i { color: var(--primary); }
.footer-map-wrap {
    width: 100%;
    height: 220px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #1e1e1e;
}
.footer-map-wrap iframe {
    display: block;
    /* 深色模式：反轉色調 + 旋轉色相還原地標顏色 */
    filter: invert(90%) hue-rotate(180deg) saturate(0.85) brightness(0.88);
}
.footer-map-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--primary);
    text-decoration: none;
    transition: 0.2s;
    width: fit-content;
}
.footer-map-link:hover { color: var(--accent); gap: 9px; }

/* Footer 底部版權欄 */
.footer-bottom {
    padding: 1.2rem 2rem;
    background: #040406;
}
.footer-bottom-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.8rem;
}
.footer-copyright {
    color: #3a3a4a;
    font-size: 0.78rem;
}
.footer-sitemap-link {
    color: #3a3a4a;
    font-size: 0.78rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: 0.2s;
}
.footer-sitemap-link:hover { color: #888; }

/* ======================================================
   浮動聯絡氣泡
   ====================================================== */
@keyframes bubbleSlideIn {
    from { opacity: 0; transform: translateX(30px) scale(0.9); }
    to   { opacity: 1; transform: translateX(0)    scale(1);   }
}
@keyframes bubbleSlideOut {
    from { opacity: 1; transform: translateX(0)    scale(1);   }
    to   { opacity: 0; transform: translateX(30px) scale(0.9); }
}

.contact-bubble {
    position: fixed;
    right: 24px;
    bottom: 100px;
    z-index: 901;
    display: flex;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s, transform 0.35s;
}
.contact-bubble.visible {
    opacity: 1;
    pointer-events: auto;
    animation: bubbleSlideIn 0.5s cubic-bezier(0.34, 1.4, 0.64, 1) forwards;
}
.contact-bubble.dismissing {
    animation: bubbleSlideOut 0.35s ease forwards;
}

/* 關閉按鈕 */
.contact-bubble-close {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: #1a1a2a;
    border: 1px solid #333;
    color: #666;
    font-size: 0.65rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: 0.2s;
    position: absolute;
    top: -8px; left: -8px;
    z-index: 2;
    flex-shrink: 0;
}
.contact-bubble-close:hover { background: #c0392b; border-color: #c0392b; color: white; }

/* 主體連結 */
.contact-bubble-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.1rem 0.75rem 0.85rem;
    background: rgba(8, 8, 20, 0.92);
    border: 1px solid rgba(37, 99, 235, 0.4);
    border-radius: 50px;
    text-decoration: none;
    backdrop-filter: blur(14px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.55), 0 0 0 1px rgba(37,99,235,0.08);
    transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
    white-space: nowrap;
}
.contact-bubble-link:hover {
    border-color: var(--primary);
    box-shadow: 0 12px 40px rgba(37,99,235,0.3), 0 0 0 1px rgba(37,99,235,0.2);
    transform: translateY(-2px);
}

/* 圖示圓圈 */
.contact-bubble-icon {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--primary);
    display: flex; align-items: center; justify-content: center;
    color: white;
    font-size: 0.95rem;
    flex-shrink: 0;
    transition: transform 0.25s;
}
.contact-bubble-link:hover .contact-bubble-icon { transform: rotate(-10deg) scale(1.1); }

/* 文字 */
.contact-bubble-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.contact-bubble-label {
    font-size: 0.7rem;
    color: #666;
    line-height: 1;
}
.contact-bubble-cta {
    font-size: 0.88rem;
    font-weight: 600;
    color: white;
    line-height: 1;
}

/* 右側箭頭 */
.contact-bubble-arrow {
    color: #444;
    font-size: 0.7rem;
    transition: transform 0.2s, color 0.2s;
}
.contact-bubble-link:hover .contact-bubble-arrow {
    transform: translateX(3px);
    color: var(--primary);
}

/* ======================================================
   回到頂部按鈕
   ====================================================== */
.back-to-top {
    position: fixed; bottom: 30px; right: 30px;
    width: 46px; height: 46px;
    background: rgba(20, 20, 30, 0.85); border: 1px solid #333;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    color: #888; font-size: 1rem; cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4); z-index: 900;
    opacity: 0; visibility: hidden; transition: 0.3s; backdrop-filter: blur(8px);
}
.back-to-top:hover { background: var(--primary); border-color: var(--primary); color: white; transform: translateY(-3px); }
.back-to-top.show { opacity: 1; visibility: visible; }

/* ======================================================
   RWD — 響應式斷點
   ====================================================== */
@media (max-width: 1024px) {
    .nav-links { display: none; }
    .hamburger { display: flex; }
}

@media (max-width: 900px) {
    .footer-nav-inner { grid-template-columns: repeat(2, 1fr); gap: 2rem; }
    .footer-top-inner { grid-template-columns: 1fr; }
    .footer-map-wrap { height: 200px; }
}

@media (max-width: 600px) {
    .footer-nav-inner { grid-template-columns: 1fr; gap: 1.5rem; }
    .footer-bottom-inner { flex-direction: column; align-items: flex-start; gap: 0.6rem; }
    .footer-contact-info { flex-direction: column; gap: 0.6rem; }
}
