:root {
    --p-blue: #3b82f6;
    --p-purple: #8b5cf6;
    --p-pink: #ec4899;
    --p-orange: #f97316;
    --p-green: #10b981;
    --bg-white: #ffffff;
    --bg-soft: #f8fafc;
    --text-main: #0f172a;
    --text-dim: #64748b;
    --glass: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.8);
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', 'Noto Sans TC', sans-serif;
    background: var(--bg-white);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* 淺色炫彩網格背景 */
.bg-decor {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background: var(--bg-white);
    overflow: hidden;
}

.bg-blob {
    position: absolute;
    width: 50vw;
    height: 50vw;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    animation: blobMove 20s infinite alternate ease-in-out;
}

.bg-blob:nth-child(1) {
    background: var(--p-blue);
    top: -10%;
    left: -10%;
}

.bg-blob:nth-child(2) {
    background: var(--p-purple);
    bottom: -10%;
    right: -10%;
    animation-delay: -5s;
}

.bg-blob:nth-child(3) {
    background: var(--p-orange);
    top: 30%;
    left: 40%;
    animation-delay: -10s;
}

@keyframes blobMove {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(10vw, 15vh) scale(1.3);
    }
}

/* 強化幾何圖案樣式 (放大設計) */
.bg-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.4;
    pointer-events: none;
}

.bg-pattern.dots {
    background-image: radial-gradient(rgba(0, 0, 0, 0.1) 1.5px, transparent 1.5px);
    background-size: 60px 60px;
    /* 放大 */
}

.bg-pattern.grid {
    background-image: linear-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
    background-size: 200px 200px;
    /* 放大 */
}

.bg-geo {
    position: absolute;
    border: 3px solid rgba(0, 0, 0, 0.04);
    background: transparent;
    border-radius: 8px;
    animation: geoRotate 40s infinite linear;
}

.shape-1 {
    width: 250px;
    /* 放大 */
    height: 250px;
    top: 15%;
    left: 5%;
    transform: rotate(45deg);
    filter: blur(2px);
}

.shape-2 {
    width: 180px;
    /* 放大 */
    height: 180px;
    top: 55%;
    right: 10%;
    border-radius: 50%;
    border: 4px solid rgba(0, 0, 0, 0.03);
}

.shape-3 {
    width: 120px;
    /* 放大 */
    height: 120px;
    bottom: 15%;
    left: 15%;
    border: 3px dashed rgba(0, 0, 0, 0.08);
}

@keyframes geoRotate {
    0% {
        transform: rotate(0deg) translate(0, 0);
    }

    50% {
        transform: rotate(180deg) translate(40px, 40px);
    }

    100% {
        transform: rotate(360deg) translate(0, 0);
    }
}

/* 新增：華麗光線特效 */
.light-ray {
    position: absolute;
    width: 100vw;
    height: 200vh;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.4) 50%, transparent 100%);
    top: -50%;
    left: -50%;
    transform: rotate(-45deg) translateY(-100%);
    pointer-events: none;
    z-index: -1;
    animation: rayFlow 12s infinite ease-in-out;
}

.ray-2 {
    animation-delay: -4s;
    opacity: 0.3;
}

.ray-3 {
    animation-delay: -8s;
    opacity: 0.2;
}

@keyframes rayFlow {
    0% {
        transform: rotate(-45deg) translateY(-100%);
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        transform: rotate(-45deg) translateY(100%);
        opacity: 0;
    }
}

header {
    padding: 20px 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-text {
    font-size: 1.6rem;
    font-weight: 950;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--p-blue), var(--p-purple));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    z-index: 1001;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dim);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.nav-links a:hover {
    color: var(--p-blue);
}

.btn-contact {
    border: 2px solid var(--text-main);
    padding: 10px 28px;
    border-radius: 50px;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 700;
    transition: all 0.3s;
}

.btn-contact:hover {
    background: var(--text-main);
    color: white;
}

/* 漢堡菜單切換鈕樣式 */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    z-index: 1001;
    padding: 5px;
}

.menu-toggle .bar {
    width: 28px;
    height: 3px;
    background-color: var(--text-main);
    margin: 3px 0;
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 3px;
}

/* 行動版導覽選單樣式 */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(30px);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.5s cubic-bezier(0.77, 0, 0.175, 1);
}

.mobile-nav-overlay.active {
    right: 0;
}

.mobile-nav-links {
    list-style: none;
    text-align: center;
}

.mobile-nav-links li {
    margin: 30px 0;
    opacity: 0;
    transform: translateY(20px);
    transition: 0.4s;
}

.mobile-nav-overlay.active .mobile-nav-links li {
    opacity: 1;
    transform: translateY(0);
}

.mobile-nav-links a {
    text-decoration: none;
    font-size: 2rem;
    font-weight: 900;
    color: var(--text-main);
    letter-spacing: -1px;
}

.btn-contact-mobile {
    margin-top: 20px;
    display: inline-block;
    padding: 15px 40px;
    background: var(--text-main);
    color: white !important;
    border-radius: 50px;
}

/* 漢堡菜單激活動畫 */
.menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .bar:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.menu-toggle.active .bar:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* Hero Section */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 120px 0 60px;
}

h1 {
    font-size: clamp(2.8rem, 10vw, 5rem);
    font-weight: 1000;
    margin-bottom: 25px;
    letter-spacing: -3px;
    color: var(--text-main);
}

.subtitle {
    font-size: clamp(1rem, 3.5vw, 1.5rem);
    color: var(--text-dim);
    margin-bottom: 60px;
    max-width: 850px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.4;
}

/* --- 混合視覺：2D 導覽 + 3D C環裝飾 --- */
.hex-grid-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    aspect-ratio: 1 / 1;
    margin: 80px auto 40px;
    perspective: 2000px;
    /* 防止 C 環旋轉時超出容器導致手機端水平抖動 */
    overflow: hidden;
    z-index: 1;
}

/* 奢華 3D C 環 - 恢復空間感 */
.hex-decoration-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    top: -20%;
    left: -9%;
    border: 3px double rgba(59, 130, 246, 0.4);
    border-right-color: rgb(59 130 246 / 0%);
    border-bottom-color: rgb(255 254 0 / 52%);
    border-radius: 50%;
    transform: rotateX(55deg) rotateY(-35deg) translateZ(-150px);
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.3), inset 0 0 20px rgba(59, 130, 246, 0.2);
    pointer-events: none;
    z-index: 1;
    transform-style: preserve-3d;
    will-change: transform;
    /* 提前啟用硬體加速 */
    animation: ringOrbit3D 20s infinite linear;
}

@keyframes ringOrbit3D {
    0% {
        transform: rotateX(55deg) rotateY(-35deg) translateZ(-150px) rotateZ(0deg);
    }

    100% {
        transform: rotateX(55deg) rotateY(-35deg) translateZ(-150px) rotateZ(360deg);
    }
}

.hex-grid {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 5;
}

.hex-item {
    width: 28%;
    aspect-ratio: 1 / 1.15;
    position: absolute;
    cursor: pointer;
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.hex-item:hover {
    transform: scale(1.1);
    z-index: 100 !important;
}

/* 移除柱體相關容器與側面 */
.hex-prism {
    width: 100%;
    height: 100%;
    position: relative;
}

.hex-side {
    display: none !important;
}

/* 2D 六角形面片 - 旗艦視覺 */
.hex-top {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: rgb(255 188 188 / 84%);
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: 0.3s;
}

.hex-item:hover .hex-text {
    color: white;
}

.hex-item:hover .hex-top {
    background: rgb(66 62 255 / 80%);
    border-color: var(--p-blue);
    box-shadow: 0 15px 45px rgba(59, 130, 246, 0.2);
}

.hex-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-align: center;
}

.hex-icon {
    font-size: clamp(2rem, 6vw, 3rem);
    margin-bottom: 10px;
    color: var(--p-blue);
    transition: 0.3s;
}

.hex-text {
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 1px;
    color: var(--text-main);
}

.hex-item:hover .hex-icon {
    transform: translateY(-5px);
}

/* 中心 Logo 六角形 */
.center-hex {
    z-index: 50;
    opacity: 1 !important;
}

.center-hex .hex-top {
    background: linear-gradient(135deg, var(--p-blue), var(--p-purple));
    color: white;
    border: none;
    box-shadow: 0 15px 50px rgba(59, 130, 246, 0.3);
}

.center-hex .hex-icon,
.center-hex .hex-text {
    color: white;
}

.hex-center-text {
    font-weight: 1000;
    font-size: 2rem;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* 佈局位置微調 */
.hex-item:nth-child(1) {
    top: 0;
    left: 36%;
}

.hex-item:nth-child(2) {
    top: 28%;
    left: 5%;
}

.hex-item:nth-child(3) {
    top: 28%;
    left: 67%;
}

.hex-item:nth-child(4) {
    top: 56%;
    left: 36%;
}

.center-hex {
    top: 28%;
    left: 36%;
}

/* 響應式優化 */
@media (max-width: 900px) {
    .hex-grid-container {
        transform: scale(0.85);
        margin: 40px auto;
        z-index: 1;
    }

    .nav-links,
    .btn-contact {
        display: none;
    }

    .menu-toggle {
        display: flex;
    }
}

@media (max-width: 600px) {
    .hex-grid-container {
        transform: scale(1);
        max-width: 95vw;
        height: 63vh;
        /* 增加高度以容納拉開的六角形 */
    }

    .hex-item {
        width: 38%;
    }

    /* 手機端垂直拉開間距，防止重疊 */
    .hex-item:nth-child(1) {
        top: 0;
        left: 31%;
    }

    .hex-item:nth-child(2) {
        top: 36%;
        left: 0;
    }

    .hex-item:nth-child(3) {
        top: 36%;
        left: 62%;
    }

    .hex-item:nth-child(4) {
        top: 72%;
        left: 31%;
    }

    .center-hex {
        top: 36%;
        left: 31%;
    }

    .hex-decoration-ring {
        width: 110%;
        /* 恢復接近正圓比例 */
        height: 110%;
        top: -5%;
        left: -5%;
        border-width: 2px;
        /* 減輕渲染負擔 */
    }

    h1 {
        font-size: 2.8rem;
    }
}

/* 隱藏過時元素 */
.hex-link,
.hex-glow-pulse {
    display: none;
}

footer {
    background: var(--bg-soft);
    padding: 100px 0 40px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 60px;
    margin-bottom: 60px;
}

.company-info p {
    color: var(--text-dim);
}

.footer-links ul {
    list-style: none;
}

.footer-links ul li {
    margin-bottom: 12px;
}

.footer-links a {
    text-decoration: none;
    color: var(--text-dim);
    font-weight: 500;
    transition: 0.3s;
}

.footer-links a:hover {
    color: var(--p-blue);
    padding-left: 5px;
}

.copyright {
    text-align: center;
    padding-top: 40px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    color: var(--text-dim);
    font-size: 0.9rem;
    font-weight: 500;
}

/* --- [REDUNDANT BLOCK - CLEANING] --- */


@media (max-width: 600px) {
    header {
        padding: 15px 0;
    }

    .hex-top {
        transform: translateZ(15px);
    }

    /* 行動版柱體減半 */
    .hex-side-1,
    .hex-side-2,
    .hex-side-3 {
        transform: translateZ(13px);
    }

    .hex-grid-container {
        max-width: 90vw;
    }

    .subtitle {
        margin-bottom: 40px;
    }

    h1 {
        font-size: 2.8rem;
    }
}