/* =========================================
   GLOBAL STYLES (style.css)
   適用於所有頁面的通用樣式：變數、導航、頁尾、表單
   ========================================= */

/* --- 0. 設計系統 (White Atelier Theme) --- */
:root {
    --c-bg: #FAFAF8; 
    --c-surface: #FFFFFF;
    --c-text-main: #2A2A2A; 
    --c-text-sub: #666666;
    --c-text-light: #999999;
    --c-accent: #FF6B35; 
    --c-accent-glow: rgba(255, 107, 53, 0.4);
    --c-tech-green: #ccff00;
    --c-border: rgba(0, 0, 0, 0.08);

    --f-display: 'Outfit', sans-serif;
    --f-body: 'Noto Sans TC', sans-serif;
    --f-mono: 'JetBrains Mono', monospace;

    --header-h: 80px;
}

/* --- 1. 基礎設定 --- */
* { box-sizing: border-box; margin: 0; padding: 0; outline: none; }

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

body {
    background-color: var(--c-bg);
    color: var(--c-text-main);
    font-family: var(--f-body);
    font-size: 16px;
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    position: relative;
    padding-top: var(--header-h);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9999;
    opacity: 0.6;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }

/* --- 2. 導航列 (Navbar) --- */
.navbar {
    position: fixed;
    top: 0; left: 0; width: 100%;
    height: var(--header-h);
    background: rgba(250, 250, 248, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--c-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 3rem;
    z-index: 1000;
}

.nav-toggle {
    display: none;
    width: 38px;
    height: 32px;
    margin-left: auto;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    border-radius: 999px;
    background: var(--c-text-main);
    transition: transform 0.25s ease, opacity 0.25s ease;
}

@media (min-width: 769px) {
    .nav-toggle {
        display: none;
    }
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }

    .navbar {
        gap: 1rem;
    }
}

.brand { display: flex; flex-direction: column; }
.brand .logo-text { font-family: var(--f-display); font-weight: 700; font-size: 1.5rem; letter-spacing: 0.05em; color: var(--c-text-main); line-height: 1; }
.brand .logo-sub { font-family: var(--f-mono); font-size: 0.65rem; color: var(--c-text-light); text-transform: uppercase; margin-top: 4px; letter-spacing: 0.1em; }

.nav-links { display: flex; gap: 2.5rem; }
.nav-item {
    font-family: var(--f-display);
    font-size: 0.9rem;
    color: var(--c-text-sub);
    font-weight: 500;
    letter-spacing: 0.05em;
    position: relative;
    cursor: pointer;
}
.nav-item:hover, .nav-item.active { color: var(--c-text-main); }
.nav-item::after {
    content: ''; position: absolute; bottom: -4px; left: 0; width: 0%; height: 1px;
    background: var(--c-accent); transition: 0.3s ease;
}
.nav-item:hover::after, .nav-item.active::after { width: 100%; }

/* Solutions Dropdown */
.nav-group {
    position: relative;
    display: flex;
    align-items: center;
}
.nav-parent {
    cursor: pointer;
}
.nav-dropdown {
    position: absolute;
    top: 100%; /* 與導覽列底部貼齊，避免 hover 中間有空隙 */
    right: 0;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
    padding: 0.5rem 0.25rem;
    min-width: 210px;
    display: none;
    flex-direction: column;
    z-index: 1100;
}
.nav-group:hover .nav-dropdown {
    display: flex;
}
.nav-group.open .nav-dropdown {
    display: flex;
}
.nav-dropdown-item {
    font-family: var(--f-body);
    font-size: 0.85rem;
    padding: 0.4rem 0.9rem;
    color: var(--c-text-sub);
    white-space: nowrap;
}
.nav-dropdown-item:hover,
.nav-dropdown-item.active {
    color: var(--c-text-main);
    background: rgba(0, 0, 0, 0.03);
}

/* --- 3. 聯絡表單 (Contact Section) --- */
.contact-section {
    background: #FFFFFF;
    min-height: 90vh;
    padding: 6rem 10%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    border-top: 1px solid var(--c-border);
    z-index: 2;
}

.lamp-wrapper {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    position: relative;
}
.lamp-cord { width: 2px; height: 100px; background: var(--c-text-main); }
.lamp-fixture { width: 60px; height: 40px; background: var(--c-text-main); border-radius: 4px 4px 0 0; }
.lamp-bulb {
    width: 50px; height: 70px; background: #F0F0F0; border: 1px solid #DDD;
    border-radius: 0 0 25px 25px; position: relative; transition: 0.5s ease;
    box-shadow: 0 0 0 rgba(255, 107, 53, 0);
}
.lamp-bulb::after {
    content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 10px; height: 20px; background: #999; border-radius: 20px; transition: 0.3s;
}
.lamp-bulb.active {
    background: #FFF; border-color: var(--c-accent);
    box-shadow: 0 0 60px 20px rgba(255, 107, 53, 0.4), inset 0 0 20px rgba(255, 107, 53, 0.2);
}
.lamp-bulb.active::after { background: #FFD700; box-shadow: 0 0 10px #FFD700; }
.contact-instruction {
    margin-top: 4rem; font-family: var(--f-mono); font-size: 0.8rem;
    color: var(--c-text-light); text-align: center; line-height: 1.6; opacity: 0.7;
}

.contact-form { display: flex; flex-direction: column; gap: 2rem; }
.form-group { position: relative; }
.form-label {
    font-family: var(--f-mono); font-size: 0.75rem; color: var(--c-accent);
    margin-bottom: 0.5rem; display: block; text-transform: uppercase; letter-spacing: 0.1em;
}
.form-input, .form-textarea, .form-select {
    width: 100%; border: none; border-bottom: 1px solid #DDD; padding: 1rem 0;
    font-family: var(--f-body); font-size: 1.1rem; color: var(--c-text-main);
    background: transparent; transition: 0.3s; border-radius: 0;
}
.form-input:focus, .form-textarea:focus, .form-select:focus { border-color: var(--c-accent); }
.form-textarea { resize: vertical; min-height: 120px; }
.submit-btn {
    align-self: flex-start; background: var(--c-text-main); color: #FFF;
    padding: 16px 32px; font-family: var(--f-display); font-size: 0.9rem;
    letter-spacing: 0.1em; border: none; cursor: pointer; transition: 0.3s; margin-top: 1rem;
}
.submit-btn:hover { background: var(--c-accent); box-shadow: 0 5px 20px rgba(255, 107, 53, 0.3); }

.sent-overlay {
    position: absolute; top:0; left:0; width:100%; height:100%;
    background: rgba(255,255,255,0.9); display: flex; align-items: center; justify-content: center;
    flex-direction: column; opacity: 0; pointer-events: none; transition: 0.5s; z-index: 10;
}
.sent-overlay.visible { opacity: 1; pointer-events: auto; }

/* --- 4. 懸浮視窗 (Concierge Widget) --- */
.concierge-widget {
    position: fixed; bottom: 2.5rem; right: 2.5rem; width: 320px;
    background: rgba(255, 255, 255, 0.75); backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px); border: 1px solid #FFF;
    border-radius: 12px; padding: 1.5rem; z-index: 999;
    box-shadow: 0 20px 40px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.02);
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.4s ease;
    opacity: 1; transform: translateY(0);
}
.concierge-widget.hidden { opacity: 0; transform: translateY(20px); pointer-events: none; }
.widget-header {
    font-family: var(--f-mono); font-size: 0.7rem; color: var(--c-text-light);
    margin-bottom: 1rem; display: flex; justify-content: space-between; align-items: center;
}
.widget-body {
    font-family: var(--f-body); font-size: 0.95rem; color: var(--c-text-main);
    margin-bottom: 1rem; font-weight: 500;
}
.widget-select {
    width: 100%; padding: 10px; margin-bottom: 10px; border: 1px solid #EAEAEA;
    border-radius: 6px; background: #FFF; font-family: var(--f-body); color: var(--c-text-sub); cursor: pointer;
}
.widget-action-btn {
    width: 100%; background: var(--c-text-main); color: #FFF; border: none;
    padding: 10px; border-radius: 6px; font-family: var(--f-display); text-transform: uppercase;
    font-size: 0.8rem; cursor: pointer; transition: 0.3s;
}
.widget-action-btn:hover { background: var(--c-accent); }

/* --- 5. 頁尾 (Footer) --- */
.site-footer {
    background: #FAFAF8;
    padding: 4rem 3rem 2rem;
    border-top: 1px solid var(--c-border);
    margin-top: auto;
    position: relative;
    z-index: 2;
}
.footer-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}
.site-footer--home .footer-content {
    display: flex;
    align-items: center;
    gap: 3rem;
}
.site-footer--home .footer-col {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.site-footer--home .footer-col h4 {
    margin: 0;
}
.site-footer--home .footer-links {
    display: flex;
    gap: 1.5rem;
}
.footer-brand .f-logo {
    font-family: var(--f-display); font-weight: 700; font-size: 1.2rem; color: var(--c-text-main);
    display: flex; align-items: center; gap: 0.75rem;
}
.footer-brand .f-sub {
    font-family: var(--f-mono); font-size: 0.6rem; color: var(--c-text-light); margin-top: 0.5rem;
}
.footer-logo-img {
    width: 108px; height: auto; display: block;
}
.footer-col h4 {
    font-family: var(--f-mono); font-size: 0.7rem; color: var(--c-text-light);
    text-transform: uppercase; margin-bottom: 1rem; letter-spacing: 0.1em;
}
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 0.5rem; }
.footer-links a {
    font-family: var(--f-body); font-size: 0.9rem; color: var(--c-text-sub);
    cursor: pointer;
}
.footer-links a:hover { color: var(--c-accent); }

.footer-bottom {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(0,0,0,0.05);
}
.footer-bottom-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.copyright {
    font-family: var(--f-mono);
    font-size: 0.7rem;
    color: var(--c-text-light);
}
.social-links a {
    margin-left: 1rem;
    font-family: var(--f-display);
    font-size: 0.8rem;
    color: var(--c-text-main);
}
.footer-email {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--f-mono);
    font-size: 0.8rem;
    color: var(--c-text-sub);
}
.footer-email-icon {
    font-size: 0.9rem;
    color: var(--c-accent);
}
.footer-icon {
    margin-right: 0.35rem;
}
.footer-legal {
    font-family: var(--f-body);
    font-size: 0.78rem;
    color: var(--c-text-light);
    line-height: 1.7;
}
.footer-legal a {
    color: var(--c-accent);
}
.footer-legal a:hover {
    text-decoration: underline;
}

/* --- 6. 手機全螢幕選單 (Mobile Nav Overlay) --- */
.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    z-index: 1200;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.nav-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.nav-overlay-inner {
    max-width: 480px;
    margin: 0 auto;
    padding: 5rem 2rem 2.5rem;
    color: #F9FAFB;
}

.nav-overlay-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid rgba(248, 250, 252, 0.4);
    background: transparent;
    color: #F9FAFB;
    font-size: 1.3rem;
    cursor: pointer;
}

.nav-overlay-brand {
    margin-bottom: 2.5rem;
}

.nav-overlay-logo-text {
    font-family: var(--f-display);
    font-size: 1.35rem;
    letter-spacing: 0.08em;
}

.nav-overlay-logo-sub {
    font-family: var(--f-mono);
    font-size: 0.75rem;
    color: rgba(248, 250, 252, 0.7);
    letter-spacing: 0.16em;
    margin-top: 0.4rem;
}

.nav-overlay-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.nav-overlay-list a {
    display: inline-block;
    font-family: var(--f-display);
    font-size: 1.05rem;
    color: #F9FAFB;
    transition: color 0.2s ease;
}

.nav-overlay-group-label {
    margin-top: 1.8rem;
    font-family: var(--f-mono);
    font-size: 0.8rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(248, 250, 252, 0.65);
}

.nav-overlay-list a:hover,
.nav-overlay-list a:active,
.nav-overlay-list a:focus-visible {
    color: var(--c-accent);
}

/* RWD：平板與手機共用（<= 1024px） */
@media (max-width: 1024px) {
    .navbar {
        padding: 0 2rem;
    }

    .site-footer {
        padding: 3.5rem 2rem 2rem;
    }

    .footer-content {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 2.5rem;
    }

    .site-footer--home .footer-content {
        display: flex;
        flex-wrap: wrap;
        gap: 2rem;
    }
}

/* RWD：手機主斷點（<= 768px） */
@media (max-width: 768px) {
    body {
        padding-top: 60px;
        font-size: 0.9375rem; /* 15px / 16 */
    }

    .navbar {
        padding: 0 1.5rem;
        height: 60px;
    }

    .brand .logo-text {
        font-size: 1.2rem;
    }

    .nav-links {
        display: none;
    }

    .contact-section {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 4rem 1.5rem;
    }

    .lamp-wrapper {
        display: none;
    }

    .concierge-widget {
        left: 1rem;
        right: 1rem;
        width: auto;
        bottom: 1rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .site-footer {
        padding: 3rem 1.5rem 1.75rem;
    }

    .site-footer--home .footer-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.75rem;
    }

    .site-footer--home .footer-col {
        align-items: flex-start;
    }

    .site-footer--home .footer-links {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }

    .footer-bottom {
        align-items: flex-start;
    }

    .site-footer--home .footer-email {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .site-footer--home .footer-copy-inline {
        display: block;
        font-size: 0.7rem;
        color: var(--c-text-light);
    }

    .site-footer--home .footer-bottom {
        padding-top: 1.4rem;
    }

    /* 手機：所有主要內文字容器強制可斷行，避免溢出 */
    .body-text,
    .sub-text,
    .sub-header-intro,
    .carousel-desc,
    .system-slide .slide-text,
    .footer-legal,
    .contact-flow-header p,
    .flow-step p {
        overflow-wrap: break-word;
        word-wrap: break-word;
        word-break: break-word;
    }

    /* 手機版：隱藏 Solutions 三個連結，只保留 email */
    .footer-links--solutions li:not(.footer-email) {
        display: none;
    }
}

/* RWD：小螢幕手機（<= 375px） */
@media (max-width: 375px) {
    .navbar {
        padding: 0 1.1rem;
    }

    .brand .logo-text {
        font-size: 1.05rem;
    }

    .brand .logo-sub {
        font-size: 0.6rem;
    }

    .site-footer {
        padding-inline: 1.25rem;
    }
}


