/* =========================================
   1. 全域變數與基礎設定
   ========================================= */
:root {
    --bg-primary: #0a0e27;
    --bg-secondary: #151932;
    --bg-card: #1a1f3a;
    --text-primary: #e4e4e7;
    --text-secondary: #94a3b8;
    --accent-primary: #00d9ff;
    --accent-secondary: #7c3aed;
    --accent-gradient: linear-gradient(135deg, #00d9ff 0%, #7c3aed 100%);
    --glow-color: rgba(0, 217, 255, 0.4);
    --border-color: rgba(255, 255, 255, 0.1);
    --scroll-progress: 0%; 
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans TC', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 217, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 217, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }
img { display: block; max-width: 100%; }

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
}

/* =========================================
   2. 導覽列 - 全新設計
   ========================================= */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(10, 14, 39, 0.7);
    backdrop-filter: blur(20px);
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background: rgba(10, 14, 39, 0.95);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
    position: relative;
}

/* Logo 設計 */
.logo {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.8rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 10;
    transition: 0.3s;
}

.logo:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 10px var(--accent-primary));
}

.logo::before {
    content: '<';
    position: absolute;
    left: -20px;
    color: var(--accent-primary);
    animation: blink 2s infinite;
}

.logo::after {
    content: '/>';
    position: absolute;
    right: -30px;
    color: var(--accent-secondary);
    animation: blink 2s infinite 1s;
}

/* 導覽連結 */
.nav-links { 
    display: flex; 
    gap: 0;
    align-items: center;
}

.nav-links li {
    position: relative;
}

.nav-links a {
    display: block;
    padding: 10px 24px;
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    transition: color 0.3s;
}

.nav-links a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(0, 217, 255, 0.1);
    transition: 0.3s;
    z-index: -1;
}

.nav-links a:hover::before {
    left: 0;
}

.nav-links a:hover {
    color: var(--accent-primary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--accent-gradient);
    transition: 0.3s;
}

.nav-links a:hover::after {
    width: 80%;
}

/* 漢堡選單按鈕 */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    z-index: 10;
}

.menu-toggle span {
    width: 28px;
    height: 3px;
    background: var(--accent-primary);
    border-radius: 2px;
    transition: 0.3s;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

/* =========================================
   3. Hero 區塊 - 全新酷炫設計
   ========================================= */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 80px;
    position: relative;
    overflow: hidden;
}

/* 動態粒子背景 */
.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--accent-primary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-primary);
    animation: particleFloat 20s infinite;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; }
.particle:nth-child(2) { left: 30%; animation-delay: 2s; }
.particle:nth-child(3) { left: 50%; animation-delay: 4s; }
.particle:nth-child(4) { left: 70%; animation-delay: 6s; }
.particle:nth-child(5) { left: 90%; animation-delay: 8s; }

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) scale(1);
        opacity: 0;
    }
}

/* 光暈效果增強 */
.hero-section::before {
    content: '';
    position: absolute;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, var(--glow-color) 0%, transparent 70%);
    top: -300px;
    right: -300px;
    animation: pulseGlow 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes pulseGlow {
    0%, 100% { 
        transform: translate(0, 0) scale(1);
        opacity: 0.3;
    }
    50% { 
        transform: translate(-50px, 50px) scale(1.2);
        opacity: 0.5;
    }
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5rem;
    align-items: center;
    width: 100%;
}

/* 狀態徽章 */
.greeting-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: rgba(0, 217, 255, 0.1);
    border: 1px solid var(--accent-primary);
    border-radius: 30px;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: var(--accent-primary);
    font-family: 'JetBrains Mono', monospace;
    margin-top: 20px;    /* 增加頂部緩衝，避免貼齊邊緣被切切到 */
    line-height: 1.2; 
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #00ff55;
    border-radius: 50%;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* 標題加上 Glitch 效果 */
.hero-text h1 { 
    font-size: 4.5rem; 
    margin-bottom: 1.5rem;
    line-height: 1.4;
    font-weight: 800;
    word-break: keep-all;
}

.glitch {
    position: relative;
    display: inline-block;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    animation: glitch-1 2.5s infinite;
    clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
    transform: translate(-0.025em, -0.0125em);
}

.glitch::after {
    animation: glitch-2 2.5s infinite;
    clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
    transform: translate(0.025em, 0.0125em);
}

@keyframes glitch-1 {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-3px, 3px); }
    40% { transform: translate(-3px, -3px); }
    60% { transform: translate(3px, 3px); }
    80% { transform: translate(3px, -3px); }
}

@keyframes glitch-2 {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(3px, -3px); }
    40% { transform: translate(3px, 3px); }
    60% { transform: translate(-3px, -3px); }
    80% { transform: translate(-3px, 3px); }
}

.hero-text .highlight { 
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-text h2 {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2rem;
    color: var(--accent-primary);
    margin-bottom: 2rem;
    height: 2.5em;
    font-weight: 600;
}

/* 程式碼風格簡介 */
.hero-text .bio {
    color: var(--text-secondary);
    margin-bottom: 3rem;
    font-size: 1.1rem;
    line-height: 2;
    font-family: 'JetBrains Mono', monospace;
    background: rgba(0, 217, 255, 0.05);
    padding: 1.5rem;
    border-radius: 10px;
    border-left: 3px solid var(--accent-primary);
}

.code-bracket {
    color: var(--accent-secondary);
    font-weight: 700;
}

/* 數據統計 */
.stats-row {
    display: flex;
    gap: 5rem;
    margin-bottom: 3rem;
    justify-content: flex-start;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* 大頭貼 - 科技框架升級版 */
.hero-image {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-frame {
    position: relative;
    width: 450px;
    height: 450px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 四角框架 */
.corner {
    position: absolute;
    width: 60px;
    height: 60px;
    border: 3px solid var(--accent-primary);
}

.corner-tl {
    top: 0;
    left: 0;
    border-right: none;
    border-bottom: none;
    animation: cornerPulse 3s infinite;
}

.corner-tr {
    top: 0;
    right: 0;
    border-left: none;
    border-bottom: none;
    animation: cornerPulse 3s infinite 0.75s;
}

.corner-bl {
    bottom: 0;
    left: 0;
    border-right: none;
    border-top: none;
    animation: cornerPulse 3s infinite 1.5s;
}

.corner-br {
    bottom: 0;
    right: 0;
    border-left: none;
    border-top: none;
    animation: cornerPulse 3s infinite 2.25s;
}

@keyframes cornerPulse {
    0%, 100% {
        box-shadow: 0 0 0 var(--accent-primary);
    }
    50% {
        box-shadow: 0 0 20px var(--accent-primary);
    }
}

/* 掃描線 */
.scan-line {
    position: absolute;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
    top: 0;
    animation: scan 4s linear infinite;
    box-shadow: 0 0 10px var(--accent-primary);
}

@keyframes scan {
    0% { top: 0; }
    100% { top: 100%; }
}

.image-frame img {
    width: 380px;
    height: 380px;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid var(--accent-primary);
    box-shadow: 
        0 0 40px var(--glow-color),
        inset 0 0 20px rgba(0, 217, 255, 0.1);
    transition: 0.5s;
    position: relative;
    z-index: 2;
    filter: brightness(1.1) contrast(1.1);
}

.hero-image:hover .image-frame img {
    transform: scale(1.05);
    box-shadow: 
        0 0 60px var(--glow-color),
        inset 0 0 30px rgba(0, 217, 255, 0.2);
}

/* 漂浮標籤 */
.floating-tags {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.float-tag {
    position: absolute;
    padding: 8px 16px;
    background: rgba(0, 217, 255, 0.2);
    border: 1px solid var(--accent-primary);
    border-radius: 20px;
    color: var(--accent-primary);
    font-size: 0.85rem;
    font-family: 'JetBrains Mono', monospace;
    backdrop-filter: blur(10px);
    animation: floatTag 6s ease-in-out infinite;
    animation-delay: var(--delay);
}

.float-tag:nth-child(1) { top: 10%; right: -10%; }
.float-tag:nth-child(2) { bottom: 30%; left: -15%; }
.float-tag:nth-child(3) { top: 60%; right: -5%; }

@keyframes floatTag {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

/* 按鈕升級 */
.social-links {
    display: flex;
    gap: 1.5rem;
}

.btn {
    padding: 16px 36px;
    border-radius: 10px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: 0.3s;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn i {
    font-size: 1.2rem;
    transition: 0.3s;
}

.btn:hover i {
    transform: scale(1.2);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: 0.6s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--accent-gradient);
    color: #fff;
    border: none;
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.5);
}

.btn-primary:hover { 
    box-shadow: 0 0 40px rgba(0, 217, 255, 0.8);
    transform: translateY(-3px);
}

.btn-outline {
    border: 2px solid var(--accent-primary);
    color: var(--accent-primary);
    background: transparent;
}

.btn-outline:hover { 
    background: rgba(0, 217, 255, 0.15);
    box-shadow: 0 0 30px rgba(0, 217, 255, 0.4);
    transform: translateY(-3px);
}

/* =========================================
   4. 通用區塊
   ========================================= */
.section { 
    padding: 120px 0;
    position: relative;
}

.section-title {
    font-size: 3rem;
    margin-bottom: 4rem;
    position: relative;
    display: inline-block;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: -10px;
    width: 60%;
    height: 4px;
    background: var(--accent-gradient);
    border-radius: 2px;
}

/* =========================================
   5. 技能區塊
   ========================================= */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.skill-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    transition: 0.4s;
}

.skill-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--accent-gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: 0.4s;
}

.skill-card:hover::before {
    transform: scaleX(1);
}

.skill-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-primary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    background: var(--bg-secondary);
}

.skill-card h3 {
    color: var(--accent-primary);
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.skill-card h3::before {
    content: '//';
    color: var(--accent-secondary);
    font-family: 'JetBrains Mono', monospace;
}

.skill-card li {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 0.8rem;
    padding-left: 1.5rem;
    position: relative;
    transition: 0.3s;
}

.skill-card li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--accent-primary);
    font-size: 1.2rem;
}

.skill-card:hover li {
    color: var(--text-primary);
    transform: translateX(5px);
}

/* =========================================
   6. 作品集
   ========================================= */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2.5rem;
}

.project-card {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    transition: 0.4s;
    border: 1px solid var(--border-color);
    position: relative;
}

.project-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--accent-gradient);
    opacity: 0;
    transition: 0.4s;
    pointer-events: none;
    mix-blend-mode: overlay;
}

.project-card:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    border-color: var(--accent-primary);
}

.project-card:hover::after {
    opacity: 0.1;
}

.card-image {
    position: relative;
    height: 240px;
    overflow: hidden;
    cursor: pointer;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.6s;
    filter: grayscale(30%);
}

.project-card:hover .card-image img { 
    transform: scale(1.15);
    filter: grayscale(0%);
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.9) 0%, rgba(124, 58, 237, 0.9) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: 0.4s;
}

.project-card:hover .overlay { 
    opacity: 1; 
}

.view-hint {
    padding: 12px 28px;
    border: 2px solid #fff;
    color: #fff;
    border-radius: 30px;
    font-weight: 700;
    background: transparent;
    font-size: 1rem;
    pointer-events: none;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card-content { 
    padding: 2rem; 
}

.card-content h3 { 
    margin-bottom: 1rem;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.card-content p { 
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.tags { 
    display: flex;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.tag {
    font-size: 0.85rem;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(0, 217, 255, 0.1);
    color: var(--accent-primary);
    border: 1px solid rgba(0, 217, 255, 0.3);
    font-family: 'JetBrains Mono', monospace;
    transition: 0.3s;
}

.tag:hover {
    background: rgba(0, 217, 255, 0.2);
    transform: translateY(-2px);
}

.tag.pc { color: #00ff55; background: rgba(0, 255, 85, 0.15); border-color: rgba(0, 255, 85, 0.3); }
.tag.android { color: #8b5cf6; background: rgba(139, 92, 246, 0.15); border-color: rgba(139, 92, 246, 0.3); }
.tag.vr { color: #f472b6; background: rgba(244, 114, 182, 0.15); border-color: rgba(244, 114, 182, 0.3); }
.tag.ar { color: #17db90; background: rgba(23, 219, 144, 0.15); border-color: rgba(23, 219, 144, 0.3); }
.tag.ai { color: #2cdaf1; background: rgba(44, 218, 241, 0.15); border-color: rgba(44, 218, 241, 0.3); }
.tag.kinect { color: #ff6b6b; background: rgba(255, 107, 107, 0.15); border-color: rgba(255, 107, 107, 0.3); }
.tag.多人連線 { color: #ffd93d; background: rgba(255, 217, 61, 0.15); border-color: rgba(255, 217, 61, 0.3); }
.tag.手部辨識 { color: #6bcf7f; background: rgba(107, 207, 127, 0.15); border-color: rgba(107, 207, 127, 0.3); }
.tag.server { color: #ff8c42; background: rgba(255, 140, 66, 0.15); border-color: rgba(255, 140, 66, 0.3); }
.tag.client { color: #a29bfe; background: rgba(162, 155, 254, 0.15); border-color: rgba(162, 155, 254, 0.3); }
.tag.line { color: #06c755; background: rgba(6, 199, 85, 0.15); border-color: rgba(6, 199, 85, 0.3); }
.tag.webcam { color: #ff6348; background: rgba(255, 99, 72, 0.15); border-color: rgba(255, 99, 72, 0.3); }
.tag.雷達 { color: #ff9ff3; background: rgba(255, 159, 243, 0.15); border-color: rgba(255, 159, 243, 0.3); }
.tag.投影互動 { color: #54a0ff; background: rgba(84, 160, 255, 0.15); border-color: rgba(84, 160, 255, 0.3); }
.tag.gaussiansplatting { color: #feca57; background: rgba(254, 202, 87, 0.15); border-color: rgba(254, 202, 87, 0.3); }
.tag.ios { color: #a8e6cf; background: rgba(168, 230, 207, 0.15); border-color: rgba(168, 230, 207, 0.3); }
.tag.眼動 { color: #dfe6e9; background: rgba(223, 230, 233, 0.15); border-color: rgba(223, 230, 233, 0.3); }
.tag.arduino { color: #00979d; background: rgba(0, 151, 157, 0.15); border-color: rgba(0, 151, 157, 0.3); }
.tag.體感座椅 { color: #f368e0; background: rgba(243, 104, 224, 0.15); border-color: rgba(243, 104, 224, 0.3); }
.tag.sensor { color: #ff7979; background: rgba(255, 121, 121, 0.15); border-color: rgba(255, 121, 121, 0.3); }
.tag.steam { color: #00adee; background: rgba(0, 173, 238, 0.15); border-color: rgba(0, 173, 238, 0.3); }
.tag.體感互動 { color: #ffbe76; background: rgba(255, 190, 118, 0.15); border-color: rgba(255, 190, 118, 0.3); }

/* =========================================
   7. 聯絡區塊 - 全新設計
   ========================================= */
.contact-section {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

/* 背景裝飾 */
.contact-bg-decoration {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    overflow: hidden;
}

.decoration-circle {
    position: absolute;
    border: 2px solid rgba(0, 217, 255, 0.1);
    border-radius: 50%;
}

.circle-1 {
    width: 400px;
    height: 400px;
    top: -200px;
    right: -100px;
    animation: rotateCircle 20s linear infinite;
}

.circle-2 {
    width: 300px;
    height: 300px;
    bottom: -150px;
    left: -50px;
    animation: rotateCircle 15s linear infinite reverse;
}

@keyframes rotateCircle {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.decoration-line {
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-primary), transparent);
    opacity: 0.3;
}

.line-1 {
    width: 500px;
    top: 30%;
    left: -100px;
    transform: rotate(-45deg);
    animation: lineSlide 8s ease-in-out infinite;
}

.line-2 {
    width: 400px;
    bottom: 20%;
    right: -100px;
    transform: rotate(45deg);
    animation: lineSlide 10s ease-in-out infinite reverse;
}

@keyframes lineSlide {
    0%, 100% { transform: translateX(0) rotate(-45deg); }
    50% { transform: translateX(100px) rotate(-45deg); }
}

/* 聯絡區塊主體 */
.contact-wrapper {
    position: relative;
    z-index: 1;
}

.contact-header {
    text-align: center;
    margin-bottom: 5rem;
}

.contact-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 24px;
    background: rgba(0, 217, 255, 0.1);
    border: 1px solid var(--accent-primary);
    border-radius: 30px;
    color: var(--accent-primary);
    font-size: 0.9rem;
    font-family: 'JetBrains Mono', monospace;
    margin-bottom: 2rem;
}

.contact-header h2 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.contact-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* 聯絡卡片網格 */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
    margin-bottom: 5rem;
}

.contact-card {
    background: var(--bg-card);
    padding: 3rem 2rem;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: 0.4s;
}

.contact-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 217, 255, 0.1), transparent);
    transition: 0.6s;
}

.contact-card:hover::before {
    left: 100%;
}

.contact-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-primary);
    box-shadow: 0 20px 40px rgba(0, 217, 255, 0.2);
}

.card-glow {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--accent-gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: 0.4s;
}

.contact-card:hover .card-glow {
    transform: scaleX(1);
}

.card-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: rgba(0, 217, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--accent-primary);
    border: 2px solid rgba(0, 217, 255, 0.3);
    transition: 0.4s;
}

.contact-card:hover .card-icon {
    background: rgba(0, 217, 255, 0.2);
    transform: scale(1.1) rotate(360deg);
    box-shadow: 0 0 30px rgba(0, 217, 255, 0.5);
}

.contact-card h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.contact-card a,
.contact-card span {
    color: var(--text-secondary);
    font-size: 1rem;
    transition: 0.3s;
    display: inline-block;
}

.contact-card a:hover {
    color: var(--accent-primary);
    transform: translateX(5px);
}

/* 頁尾 */
footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-left {
    flex: 1;
}

.footer-logo {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.footer-tagline {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-style: italic;
}

.footer-right {
    text-align: right;
}

.footer-right p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

/* =========================================
   8. Modal
   ========================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 14, 39, 0.95);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    backdrop-filter: blur(10px);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-secondary);
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow-y: auto;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
    transform: scale(0.9);
    transition: transform 0.4s ease;
}

.modal-content::-webkit-scrollbar { width: 10px; }
.modal-content::-webkit-scrollbar-track { background: var(--bg-primary); }
.modal-content::-webkit-scrollbar-thumb { 
    background: var(--accent-primary);
    border-radius: 5px;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 25px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 2.5rem;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
    transition: 0.3s;
}

.close-btn:hover { 
    color: var(--accent-primary);
    transform: rotate(90deg);
}

.modal-header {
    padding: 3rem 3rem 2rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card);
}

.modal-header h2 { 
    font-size: 2.5rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.modal-body { 
    padding: 3rem;
}

.modal-body a {
    color: var(--accent-primary);
    text-decoration: underline;
    transition: 0.3s;
}

.modal-body a:hover {
    color: var(--accent-secondary);
}

.modal-hero-img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
    background: var(--bg-primary);
    border-radius: 12px;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
}

.modal-body p {
    color: var(--text-secondary);
    line-height: 2;
    margin-bottom: 2.5rem;
    white-space: pre-line;
    font-size: 1.1rem;
}

.gallery-title {
    font-size: 1.5rem;
    color: var(--accent-primary);
    margin-bottom: 1.5rem;
    margin-top: 3rem;
}

.modal-gallery-grid {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 1.5rem;
    padding-bottom: 20px;
    cursor: grab;
    user-select: none;
}

.modal-gallery-grid.active {
    cursor: grabbing;
}

.modal-gallery-grid::-webkit-scrollbar {
    height: 8px;
}

.modal-gallery-grid::-webkit-scrollbar-track {
    background: var(--bg-primary);
    border-radius: 4px;
}

.modal-gallery-grid::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 4px;
}

.modal-gallery-grid img {
    flex: 0 0 200px;
    height: 130px;
    object-fit: cover;
    background: var(--bg-primary);
    border-radius: 10px;
    transition: transform 0.3s;
    cursor: pointer;
    border: 2px solid transparent;
    pointer-events: auto;
}

.modal-gallery-grid img:hover {
    transform: translateY(-8px);
    border-color: var(--accent-primary);
    box-shadow: 0 10px 20px rgba(0, 217, 255, 0.3);
}

/* =========================================
   9. 動畫效果
   ========================================= */
.hidden {
    opacity: 0;
    transform: translateY(50px);
    transition: all 1s ease-out;
}

.show {
    opacity: 1;
    transform: translateY(0);
}

.delay-100 { transition-delay: 0.1s; }
.delay-200 { transition-delay: 0.2s; }
.delay-300 { transition-delay: 0.3s; }
.delay-400 { transition-delay: 0.4s; }

/* =========================================
   10. 側邊導航欄與進度條
   ========================================= */
.side-nav {
    position: fixed;
    right: 3rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 2rem;
}

/* 進度條 */
.progress-bar {
    width: 3px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--scroll-progress);
    background: var(--accent-gradient);
    transition: height 0.3s ease;
    box-shadow: 0 0 10px var(--accent-primary);
}

/* 導航連結 */
.side-nav-links {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.side-nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    text-decoration: none;
    transition: 0.3s;
}

.nav-dot {
    width: 12px;
    height: 12px;
    border: 2px solid var(--text-secondary);
    border-radius: 50%;
    background: transparent;
    transition: 0.3s;
    position: relative;
    z-index: 2;
}

.nav-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0;
    transform: translateX(-10px);
    transition: 0.3s;
    white-space: nowrap;
    pointer-events: none;
}

/* Hover 效果 */
.side-nav-link:hover .nav-dot {
    border-color: var(--accent-primary);
    background: rgba(0, 217, 255, 0.2);
    transform: scale(1.3);
}

.side-nav-link:hover .nav-label {
    opacity: 1;
    transform: translateX(0);
}

/* Active 狀態 */
.side-nav-link.active .nav-dot {
    border-color: var(--accent-primary);
    background: var(--accent-primary);
    box-shadow: 0 0 15px var(--accent-primary);
}

.side-nav-link.active .nav-label {
    color: var(--accent-primary);
}

/* =========================================
   11. RWD 響應式
   ========================================= */
@media (max-width: 1024px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
    }
    
    .hero-text h1 { 
        font-size: 3rem;
        line-height: 1.4; 
    }
    
    .image-frame {
        width: 350px;
        height: 350px;
        margin: 0 auto;
    }
    
    .image-frame img {
        width: 300px;
        height: 300px;
    }
    
    .stats-row {
        justify-content: center;
    }
    
    .floating-tags {
        display: none;
    }

    /* 側邊導航改為迷你版 */
    .side-nav {
        right: 1rem;
        gap: 1.5rem;
    }

    .progress-bar {
        width: 2px;
        height: 150px;
    }

    .side-nav-links {
        gap: 1.5rem;
    }

    .nav-dot {
        width: 10px;
        height: 10px;
    }

    .nav-label {
        display: none;
    }
}

@media (max-width: 768px) {
    /* 導覽列手機版 */
    .menu-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 80px;
        right: -100%;
        width: 280px;
        height: calc(100vh - 80px);
        background: rgba(10, 14, 39, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 3rem 0;
        gap: 0;
        border-left: 1px solid var(--border-color);
        transition: 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links a {
        padding: 1.2rem 2rem;
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .nav-links a::before {
        display: none;
    }

    .nav-links a:hover::before {
        left: 0;
    }

    .nav-links a::after {
        display: none;
    }

    /* Hero 區塊 */
    .hero-section {
        padding-top: 100px;
        min-height: auto;
        padding-bottom: 60px;
    }
    
    .hero-container {
        gap: 2rem;
    }
    
    .hero-text h1 { 
        font-size: 2rem; 
        line-height: 1.5;
        margin-bottom: 1rem;
    }
    
    .hero-text h2 { 
        font-size: 1.3rem;
        height: auto;
        margin-bottom: 1.5rem;
    }
    
    .hero-text .bio {
        font-size: 0.95rem;
        padding: 1rem;
        margin-bottom: 2rem;
    }
    
    /* 大頭貼 */
    .image-frame {
        width: 250px;
        height: 250px;
    }
    
    .image-frame img {
        width: 220px;
        height: 220px;
    }
    
    .corner {
        width: 40px;
        height: 40px;
    }
    
    .floating-tags,
    .scan-line {
        display: none;
    }
    
    /* 統計數據 */
    .stats-row {
        flex-direction: row;
        gap: 3rem;
        justify-content: center;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
    
    .stat-label {
        font-size: 0.85rem;
    }
    
    /* 按鈕 */
    .social-links {
        flex-direction: column;
        width: 100%;
        gap: 1rem;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
        padding: 14px 28px;
        font-size: 0.95rem;
    }
    
    .greeting-badge {
        font-size: 0.8rem;
        padding: 8px 16px;
    }
    
    /* 區塊間距 */
    .section { 
        padding: 60px 0;
    }
    
    .section-title { 
        font-size: 2rem;
        margin-bottom: 2.5rem;
    }
    
    /* 技能卡片 */
    .skills-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .skill-card {
        padding: 1.5rem;
    }
    
    .skill-card h3 {
        font-size: 1.2rem;
    }
    
    /* 作品集 */
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .card-image {
        height: 200px;
    }
    
    .card-content {
        padding: 1.5rem;
    }
    
    .card-content h3 {
        font-size: 1.3rem;
    }
    
    /* 聯絡區塊 */
    .contact-header h2 {
        font-size: 2rem;
        line-height: 1.4;
    }
    
    .contact-subtitle {
        font-size: 1rem;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin-bottom: 3rem;
    }
    
    .contact-card {
        padding: 2rem 1.5rem;
    }
    
    .card-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    /* 頁尾 */
    .footer-content {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    
    .footer-right {
        text-align: center;
    }
    
    /* Modal */
    .modal-content {
        width: 95%;
        max-width: 95%;
        margin: 10px;
        max-height: 85vh;
    }
    
    .modal-header {
        padding: 2rem 1.5rem 1.5rem;
    }
    
    .modal-header h2 {
        font-size: 1.8rem;
        padding-right: 30px;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .modal-body p {
        font-size: 1rem;
        line-height: 1.8;
    }
    
    .close-btn {
        font-size: 2rem;
        top: 15px;
        right: 15px;
    }
    
    .gallery-title {
        font-size: 1.2rem;
        margin-top: 2rem;
    }
    
    .modal-gallery-grid img {
        flex: 0 0 150px;
        height: 100px;
    }
    
    /* 容器 */
    .container {
        padding: 0 1.5rem;
    }
    
    /* 粒子效果 */
    .particles {
        display: none;
    }

    /* 手機版迷你側邊導航 */
    .side-nav {
        right: 0.5rem;
        background: rgba(10, 14, 39, 0.9);
        backdrop-filter: blur(15px);
        border: 1px solid var(--border-color);
        border-radius: 20px;
        padding: 0.8rem 0.4rem;
        gap: 0.8rem;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    }

    .progress-bar {
        width: 2px;
        height: 120px;
    }

    .side-nav-links {
        gap: 1rem;
    }

    .nav-dot {
        width: 8px;
        height: 8px;
        border-width: 1.5px;
    }

    .side-nav-link.active .nav-dot {
        width: 10px;
        height: 10px;
    }

    .nav-label {
        display: none;
    }

    .side-nav-link {
        padding: 0.5rem;
        min-width: 30px;
        display: flex;
        justify-content: center;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .hero-text h1 { 
        font-size: 1.8rem; 
    }
    
    .hero-text h2 { 
        font-size: 1.2rem;
    }
    
    .image-frame {
        width: 220px;
        height: 220px;
    }
    
    .image-frame img {
        width: 190px;
        height: 190px;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .section-title { 
        font-size: 1.8rem;
    }
    
    .contact-header h2 {
        font-size: 1.8rem;
    }

    /* 極小螢幕側邊導航更迷你 */
    .side-nav {
        right: 0.3rem;
        padding: 0.6rem 0.3rem;
        gap: 0.6rem;
    }

    .progress-bar {
        width: 2px;
        height: 100px;
    }

    .side-nav-links {
        gap: 0.8rem;
    }

    .nav-dot {
        width: 7px;
        height: 7px;
    }
}
