/* ==========================================================================
   Lan Fa Textile v2 - 進階現代化展示版
   ========================================================================== */

/* --- 變數定義 --- */
:root {
    --primary: #0a192f;
    --primary-light: #112240;
    --accent: #64ffda;
    /* 科技霓虹綠/藍的點綴 */
    --accent-hover: #52e0c4;
    --text-main: #ccd6f6;
    --text-muted: #8892b0;
    --white: #ffffff;
    --bg-dark: #020c1b;

    /* 玻璃擬態背景 */
    --glass-bg: rgba(17, 34, 64, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);

    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s cubic-bezier(0.645, 0.045, 0.355, 1);
}

/* --- 基礎重置 --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans TC', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-base);
}

ul {
    list-style: none;
}

/* --- 佈局工具 --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-narrow {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-padding {
    padding: 120px 0;
}

/* --- 排版與色彩 --- */
.text-gradient {
    background: linear-gradient(120deg, var(--accent) 0%, #00b4d8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-light {
    color: var(--text-main);
}

.text-light-muted {
    color: var(--text-muted);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-main);
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 60px;
}

/* --- 按鈕系統 --- */
.btn-contact,
.btn-primary,
.btn-secondary,
.btn-outline-light {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 4px;
    font-weight: 500;
    letter-spacing: 1px;
    transition: var(--transition-base);
    cursor: pointer;
}

.btn-contact {
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 8px 20px;
}

.btn-contact:hover {
    background: rgba(100, 255, 218, 0.1);
}

.btn-primary {
    background: var(--accent);
    color: var(--bg-dark);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(100, 255, 218, 0.2);
}

.btn-secondary {
    border: 1px solid var(--text-main);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
}

.btn-outline-light {
    border: 1px solid var(--text-muted);
    color: var(--text-main);
    padding: 8px 16px;
    font-size: 0.9rem;
}

.btn-outline-light:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* --- 導覽列與 Mega Menu --- */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 25px 0;
    transition: var(--transition-slow);
    background: transparent;
}

.navbar.scrolled {
    padding: 15px 0;
    background: rgba(10, 25, 47, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 12px;
    background: rgba(100, 255, 218, 0.1);
    color: var(--accent);
    font-weight: 500;
    border: 1px solid rgba(100, 255, 218, 0.2);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 40px;
}

.nav-links>li>a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-links>li>a:hover {
    color: var(--accent);
}

/* Mega Menu 核心樣式 */
.has-mega-menu {
    position: relative;
}

.mega-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    width: 600px;
    background: var(--primary-light);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    padding: 30px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 100;
}

.has-mega-menu:hover .mega-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.mega-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 30px;
}

.mega-col.intro h4 {
    color: var(--accent);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.mega-col.intro p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.mega-col.links h4 {
    color: var(--white);
    margin-bottom: 15px;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

.mega-col.links ul li {
    margin-bottom: 12px;
}

.mega-col.links ul li a {
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mega-col.links ul li a:hover {
    color: var(--accent);
    padding-left: 5px;
}

/* 針對產品的 Mega Menu 稍微寬一點 */
.has-mega-menu:nth-child(2) .mega-menu {
    width: 500px;
    transform: translateX(-30%) translateY(20px);
}

.has-mega-menu:nth-child(2):hover .mega-menu {
    transform: translateX(-30%) translateY(0);
}

/* --- 主視覺 Hero --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 80px;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 1;
    filter: brightness(0.4) saturate(1.2);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin-left: left;
    padding: 60px;
    margin-left: max(5%, calc((100vw - 1200px) / 2));
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

.eyebrow {
    color: var(--accent);
    font-family: monospace;
    font-size: 1.1rem;
    letter-spacing: 2px;
    margin-bottom: 20px;
    display: block;
}

.hero-content h1 {
    font-size: 4.5rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 30px;
    color: var(--white);
}

.hero-content p {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    max-width: 600px;
}

.hero-actions {
    display: flex;
    gap: 20px;
}

/* --- 關於我們 Tabs --- */
.tabs-container {
    background: var(--primary-light);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
}

.tabs-header {
    display: flex;
    background: rgba(2, 12, 27, 0.5);
    border-bottom: 1px solid var(--glass-border);
}

.tab-btn {
    flex: 1;
    padding: 20px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-base);
    position: relative;
}

.tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.02);
}

.tab-btn.active {
    color: var(--accent);
    background: var(--primary-light);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent);
}

.tabs-body {
    padding: 50px;
    min-height: 300px;
}

.glass-panel-dark {
    background: var(--primary-light);
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-content h3 {
    font-size: 1.8rem;
    color: var(--white);
    margin-bottom: 20px;
}

.tab-content p {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 30px;
}

.feature-list li {
    margin-bottom: 15px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.feature-list li i {
    color: var(--accent);
    font-size: 1.2rem;
}

/* --- 產品卡片區 --- */
.flex-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 60px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.dark-card {
    background: var(--primary-light);
    padding: 40px 30px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    transition: var(--transition-base);
    position: relative;
    overflow: hidden;
}

.dark-card:hover {
    transform: translateY(-10px);
    background: #172a45;
    border-color: rgba(100, 255, 218, 0.3);
}

.card-icon {
    font-size: 3rem;
    color: var(--accent);
    margin-bottom: 25px;
}

.dark-card h3 {
    font-size: 1.5rem;
    color: var(--white);
    margin-bottom: 15px;
}

.dark-card p {
    color: var(--text-muted);
    margin-bottom: 30px;
    font-size: 0.95rem;
}

.learn-more {
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.learn-more:hover {
    gap: 10px;
}

/* 箭頭動畫 */


/* --- Footer --- */
.footer {
    background: #020c1b;
    border-top: 1px solid var(--glass-border);
    padding: 80px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-brand h3 {
    color: var(--white);
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.footer-brand p {
    color: var(--text-muted);
    max-width: 300px;
}

.footer h4 {
    color: var(--white);
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.footer-links ul li {
    margin-bottom: 10px;
}

.footer-links a {
    color: var(--text-muted);
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-contact p {
    color: var(--text-muted);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-contact i {
    color: var(--accent);
}

.footer-bottom {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* --- Scroll 動畫 --- */
.reveal-up {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal-up.active {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 {
    transition-delay: 0.1s;
}

.delay-2 {
    transition-delay: 0.2s;
}

.delay-3 {
    transition-delay: 0.3s;
}

/* --- RWD --- */
@media (max-width: 900px) {
    .nav-links {
        display: none;
    }

    .hero-content h1 {
        font-size: 3rem;
    }

    .hero-content {
        margin-left: 0;
        padding: 40px 20px;
    }

    .product-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    .flex-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .tabs-header {
        flex-direction: column;
    }

    .tab-btn {
        border-bottom: 1px solid var(--glass-border);
    }
}