/* ========================================
   全域樣式與重置
======================================== */
:root {
    /* 主要顏色 */
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #f59e0b;
    --accent-color: #ec4899;
    
    /* 文字顏色 */
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    
    /* 背景顏色 */
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-dark: #111827;
    
    /* 其他顏色 */
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* 過渡效果 */
    --transition-fast: 0.2s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* 間距 */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;
    
    /* 字型 */
    --font-primary: 'Poppins', 'Noto Sans TC', sans-serif;
    --font-heading: 'Poppins', 'Noto Sans TC', sans-serif;
}

/* 深色模式變數 */
[data-theme="dark"] {
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-light: #9ca3af;
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --bg-dark: #0f172a;
    --border-color: #374151;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-primary);
    color: var(--text-primary);
    background-color: var(--bg-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color var(--transition-base), color var(--transition-base);
}

body.menu-open {
    overflow: hidden;
}

.skip-link {
    position: absolute;
    left: 16px;
    top: -64px;
    z-index: 2000;
    background: var(--bg-dark);
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: 16px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid var(--secondary-color);
    outline-offset: 2px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-fast);
}

ul {
    list-style: none;
}

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

/* ========================================
   粒子背景
======================================== */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.5;
}

/* ========================================
   主題切換按鈕
======================================== */
.theme-toggle {
    position: fixed;
    top: 100px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
    background: var(--primary-dark);
}

/* ========================================
   回到頂部按鈕
======================================== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
    background: var(--primary-dark);
}

/* ========================================
   導航欄
======================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
    z-index: 999;
    transition: all var(--transition-base);
}

[data-theme="dark"] .navbar {
    background: rgba(17, 24, 39, 0.95);
}

.navbar.scrolled {
    padding: 0.5rem 0;
    box-shadow: var(--shadow-lg);
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    transition: transform var(--transition-fast);
}

.logo:hover {
    transform: scale(1.05);
}

.nav-menu {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    position: relative;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width var(--transition-base);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* 功能實驗室特殊樣式 */
.nav-lab {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white !important;
    padding: 8px 16px;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    animation: pulse-glow 2s infinite;
}

.nav-lab:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.nav-lab::after {
    display: none;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(102, 126, 234, 0.8);
    }
}

/* 管理後台特殊樣式 */
.nav-admin {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white !important;
    padding: 8px 16px;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.nav-admin:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(245, 87, 108, 0.4);
}

.nav-admin::after {
    display: none;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    transition: all var(--transition-base);
}

/* ========================================
   Hero 區域
======================================== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 100px 0 50px;
    position: relative;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.highlight {
    color: var(--primary-color);
    position: relative;
    display: inline-block;
}

.highlight::after {
    content: '';
    position: absolute;
    bottom: 10px;
    left: 0;
    width: 100%;
    height: 15px;
    background: rgba(99, 102, 241, 0.2);
    z-index: -1;
    animation: highlightWave 2s ease-in-out infinite;
}

@keyframes highlightWave {
    0%, 100% { transform: scaleX(1); }
    50% { transform: scaleX(1.1); }
}

.typing-container {
    min-height: 60px;
}

.hero-subtitle {
    font-size: 2rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.typing-text {
    border-right: 3px solid var(--secondary-color);
}

.cursor {
    color: var(--secondary-color);
    animation: blink 0.7s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.hero-description {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all var(--transition-base);
    border: 2px solid transparent;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-3px);
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-primary);
    transition: all var(--transition-base);
}

.social-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-5px);
}

.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-wrapper {
    position: relative;
    width: 400px;
    height: 400px;
}

.image-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 150px;
    color: white;
    box-shadow: var(--shadow-xl);
    animation: float 3s ease-in-out infinite;
}

/* 個人照片樣式 */
.profile-image,
.about-profile-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: var(--shadow-xl);
    animation: float 3s ease-in-out infinite;
    border: 5px solid var(--primary-color);
}

.profile-image:hover,
.about-profile-image:hover {
    transform: scale(1.05);
    transition: transform var(--transition-base);
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.scroll-indicator span {
    width: 3px;
    height: 15px;
    background: var(--primary-color);
    border-radius: 3px;
    animation: scrollAnimation 1.5s ease-in-out infinite;
}

.scroll-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.scroll-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes scrollAnimation {
    0%, 100% { opacity: 0; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(10px); }
}

/* ========================================
   通用區域樣式
======================================== */
.section {
    padding: var(--spacing-xl) 0;
    position: relative;
}

.section:nth-child(even) {
    background: var(--bg-secondary);
}

.section-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.section-divider {
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    margin: 0 auto 1rem;
    border-radius: 2px;
}

.section-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* ========================================
   關於我區域
======================================== */
.about-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4rem;
    align-items: center;
}

.about-image-wrapper {
    width: 100%;
    max-width: 400px;
    aspect-ratio: 1;
}

.about-image-wrapper .image-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--primary-light), var(--accent-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 120px;
    color: white;
    box-shadow: var(--shadow-xl);
}

.about-image-wrapper .about-profile-image {
    width: 100%;
    height: 100%;
    border-radius: 20px;
    object-fit: cover;
    box-shadow: var(--shadow-xl);
    border: 5px solid var(--primary-color);
    animation: none;
}

.about-subtitle {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.about-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.8;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin: 2rem 0;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.about-highlights {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

.highlight-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    color: var(--text-secondary);
}

.highlight-item i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

/* ========================================
   技能區域
======================================== */
.skills-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 3rem;
    margin-bottom: 4rem;
}

.skill-category {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.skill-category:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.category-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.category-title i {
    color: var(--primary-color);
}

.skill-bars {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.skill-bar {
    width: 100%;
}

.skill-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.skill-name {
    font-weight: 600;
    color: var(--text-primary);
}

.skill-percentage {
    font-weight: 600;
    color: var(--primary-color);
}

.skill-progress {
    width: 100%;
    height: 10px;
    background: var(--bg-secondary);
    border-radius: 10px;
    overflow: hidden;
}

.skill-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: 10px;
    width: 0;
    transition: width 1.5s ease-in-out;
}

.tech-icons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.tech-icon {
    width: 100px;
    height: 100px;
    background: var(--bg-primary);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    margin: 0 auto;
}

.tech-icon:hover {
    transform: translateY(-10px) rotate(5deg);
    box-shadow: var(--shadow-xl);
    color: var(--secondary-color);
}

/* ========================================
   經歷時間軸
======================================== */
.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
}

.timeline-item {
    display: flex;
    align-items: center;
    margin-bottom: 3rem;
    position: relative;
}

.timeline-item:nth-child(odd) {
    flex-direction: row-reverse;
}

.timeline-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    box-shadow: var(--shadow-lg);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.timeline-content {
    width: calc(50% - 50px);
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

.timeline-item:nth-child(odd) .timeline-content {
    margin-right: auto;
    margin-left: 0;
}

.timeline-item:nth-child(even) .timeline-content {
    margin-left: auto;
    margin-right: 0;
}

.timeline-content:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.timeline-date {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.timeline-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.timeline-company {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.timeline-description {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.timeline-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    padding: 0.4rem 0.8rem;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* ========================================
   作品集區域
======================================== */
.project-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    background: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    color: var(--text-secondary);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary-color);
    color: white;
    transform: translateY(-3px);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--bg-primary);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 1px solid rgba(99, 102, 241, 0.1);
}

.project-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.25);
    border-color: rgba(99, 102, 241, 0.3);
}

/* 精選專案卡片 */
.project-card-featured {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(168, 85, 247, 0.05) 100%);
    border: 2px solid rgba(99, 102, 241, 0.3);
}

.project-card-featured:hover {
    box-shadow: 0 25px 50px rgba(99, 102, 241, 0.35);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(168, 85, 247, 0.08) 100%);
}

/* 專案徽章 */
.project-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #000;
    padding: 8px 16px;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: 700;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.project-badge i {
    font-size: 0.85rem;
}

/* 專案卡片入場動畫 */
.project-card {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

.project-card:nth-child(1) {
    animation-delay: 0.1s;
}

.project-card:nth-child(2) {
    animation-delay: 0.2s;
}

.project-card:nth-child(3) {
    animation-delay: 0.3s;
}

.project-card:nth-child(4) {
    animation-delay: 0.4s;
}

.project-card:nth-child(5) {
    animation-delay: 0.5s;
}

.project-card:nth-child(6) {
    animation-delay: 0.6s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.project-image {
    position: relative;
    width: 100%;
    aspect-ratio: 16/10;
    overflow: hidden;
}

.project-image .image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: white;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card:hover .image-placeholder {
    transform: scale(1.1);
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.95) 0%, rgba(168, 85, 247, 0.95) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-link {
    width: 55px;
    height: 55px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.3rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.project-link:hover {
    transform: scale(1.15) rotate(15deg);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #fff 0%, #f0f0ff 100%);
}

.project-info {
    padding: 2rem;
}

/* 專案標題區域 */
.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.8rem;
}

.project-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 狀態徽章 */
.project-status {
    display: flex;
    gap: 0.5rem;
}

.status-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.status-active {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.project-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.7;
    font-size: 0.95rem;
}

/* 專案功能特色 */
.project-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 8px 12px;
    background: rgba(99, 102, 241, 0.08);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.feature-item:hover {
    background: rgba(99, 102, 241, 0.15);
    transform: translateX(5px);
}

.feature-item i {
    color: var(--primary-color);
    font-size: 1rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
}

.tag {
    padding: 6px 14px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.tag:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* 不同顏色的標籤 */
.tag-primary {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
    border-color: rgba(99, 102, 241, 0.3);
}

.tag-primary:hover {
    background: #6366f1;
    color: white;
}

.tag-secondary {
    background: rgba(168, 85, 247, 0.1);
    color: #a855f7;
    border-color: rgba(168, 85, 247, 0.3);
}

.tag-secondary:hover {
    background: #a855f7;
    color: white;
}

.tag-accent {
    background: rgba(236, 72, 153, 0.1);
    color: #ec4899;
    border-color: rgba(236, 72, 153, 0.3);
}

.tag-accent:hover {
    background: #ec4899;
    color: white;
}

.tag-success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.3);
}

.tag-success:hover {
    background: #10b981;
    color: white;
}

/* 專案統計資訊 */
.project-stats {
    display: flex;
    gap: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(99, 102, 241, 0.1);
}

.project-stats .stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.project-stats .stat i {
    color: var(--primary-color);
}

/* ========================================
   學歷區域
======================================== */
.education-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.education-card {
    background: var(--bg-primary);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    display: flex;
    gap: 1.5rem;
}

.education-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.education-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    flex-shrink: 0;
}

.education-info {
    flex: 1;
}

.education-degree {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.education-school {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.education-date {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: 15px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.education-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.education-achievements {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.achievement {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.achievement i {
    color: var(--secondary-color);
}

.certificates {
    margin-top: 3rem;
}

.certificates-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
}

.certificates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.certificate-item {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all var(--transition-base);
}

.certificate-item:hover {
    transform: translateX(10px);
    box-shadow: var(--shadow-lg);
}

.certificate-item i {
    font-size: 2rem;
    color: var(--primary-color);
}

.certificate-item span {
    font-weight: 600;
    color: var(--text-primary);
}

/* ========================================
   聯絡我區域
======================================== */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
}

.contact-subtitle {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.contact-text {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 2rem;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.contact-icon {
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.contact-text-info h4 {
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: var(--text-primary);
}

.contact-text-info p,
.contact-text-info a {
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.contact-text-info a:hover {
    color: var(--primary-color);
}

.contact-social h4 {
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.contact-form {
    background: var(--bg-primary);
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: var(--shadow-lg);
}

.form-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--bg-secondary);
    transition: all var(--transition-base);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.error-message {
    display: block;
    color: #ef4444;
    font-size: 0.85rem;
    margin-top: 0.3rem;
}

.btn-submit {
    width: 100%;
    padding: 1rem 2rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all var(--transition-base);
}

.btn-submit:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.form-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
    font-weight: 600;
    display: none;
}

.form-message.success {
    display: block;
    background: #d1fae5;
    color: #065f46;
}

.form-message.error {
    display: block;
    background: #fee2e2;
    color: #991b1b;
}

/* ========================================
   頁尾
======================================== */
.footer {
    background: var(--bg-dark);
    color: var(--text-light);
    padding: 4rem 0 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: white;
}

.footer-text {
    line-height: 1.8;
    margin-bottom: 1rem;
}

.footer-social {
    margin-top: 1rem;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.footer-links a {
    color: var(--text-light);
    transition: all var(--transition-fast);
}

.footer-links a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

.newsletter-form {
    display: flex;
    margin-top: 1rem;
}

.newsletter-form input {
    flex: 1;
    padding: 0.875rem 1rem;
    border: none;
    border-radius: 25px 0 0 25px;
    font-family: inherit;
    font-size: 0.95rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.newsletter-form button {
    padding: 0.875rem 1.5rem;
    background: var(--primary-color);
    border: none;
    border-radius: 0 25px 25px 0;
    color: white;
    cursor: pointer;
    transition: background var(--transition-base);
}

.newsletter-form button:hover {
    background: var(--primary-dark);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom p {
    margin: 0.5rem 0;
}

.footer-bottom i {
    color: #ef4444;
}

/* ========================================
   響應式設計
======================================== */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 70px;
        right: -100%;
        width: 70%;
        height: calc(100vh - 70px);
        background: var(--bg-primary);
        flex-direction: column;
        padding: 2rem;
        box-shadow: var(--shadow-xl);
        transition: right var(--transition-base);
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.5rem;
    }
    
    .hero-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .hero-image {
        order: -1;
    }
    
    .image-wrapper {
        width: 300px;
        height: 300px;
    }
    
    .image-placeholder {
        font-size: 100px !important;
    }
    
    .about-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .about-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .about-highlights {
        grid-template-columns: 1fr;
    }
    
    .skills-content {
        grid-template-columns: 1fr;
    }
    
    .timeline::before {
        left: 30px;
    }
    
    .timeline-item {
        flex-direction: row !important;
        padding-left: 80px;
    }
    
    .timeline-icon {
        left: 30px;
        transform: translateX(0);
    }
    
    .timeline-content {
        width: 100%;
        margin: 0 !important;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .project-card-featured {
        margin-bottom: 1rem;
    }
    
    .project-badge {
        top: 15px;
        right: 15px;
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .project-info {
        padding: 1.5rem;
    }
    
    .project-title {
        font-size: 1.3rem;
    }
    
    .project-features {
        grid-template-columns: 1fr;
    }
    
    .project-link {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
    
    .education-grid {
        grid-template-columns: 1fr;
    }
    
    .education-card {
        flex-direction: column;
        text-align: center;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .theme-toggle,
    .back-to-top {
        width: 45px;
        height: 45px;
        right: 20px;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    .section {
        padding: var(--spacing-lg) 0;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .tech-icons {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    }
    
    .tech-icon {
        width: 80px;
        height: 80px;
        font-size: 2.5rem;
    }
}

/* ========================================
   ✨ 按鈕互動增強 - 波浪和涟漪效果
======================================== */

/* 涟漪效果 */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.btn {
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.btn:active::before {
    animation: ripple 0.6s ease-out;
}

/* ========================================
   卡片提升效果 - 3D深度
======================================== */

.project-card,
.skill-category,
.education-card,
.achievement-badge {
    perspective: 1000px;
    position: relative;
}

.project-card::before,
.skill-category::before,
.education-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: none;
    pointer-events: none;
    border-radius: inherit;
    transition: all 0.4s ease;
}

.project-card:hover,
.skill-category:hover,
.education-card:hover {
    box-shadow: 
        0 20px 40px rgba(99,102,241,0.15),
        0 0 20px rgba(99,102,241,0.08) inset !important;
}

/* ========================================
   文字漸入動畫
======================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-title {
    animation: fadeInUp 0.6s ease-out;
}

.section-description {
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

/* ========================================
   懸停時文字亮度變化
======================================== */

.nav-link:hover {
    text-shadow: 0 0 8px rgba(99,102,241,0.3);
}

/* ========================================
   主題/語言/音樂按鈕提升動畫
======================================== */

.theme-toggle,
.language-toggle,
.music-toggle,
.print-resume,
.back-to-top {
    box-shadow: 
        0 4px 14px rgba(99,102,241,0.2),
        0 0 0 rgba(99,102,241,0) inset;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.theme-toggle:hover,
.language-toggle:hover,
.music-toggle:hover,
.print-resume:hover,
.back-to-top:hover {
    box-shadow: 
        0 12px 24px rgba(99,102,241,0.35),
        0 0 20px rgba(99,102,241,0.1) inset !important;
}

/* ========================================
   進階輪轉與縮放
======================================== */

.hero-title {
    letter-spacing: -1px;
}

.logo:hover {
    transform: scale(1.08) rotateZ(2deg);
    text-shadow: 0 0 20px rgba(99,102,241,0.3);
}

/* ========================================
   進階過渡 - 色彩變化平滑
======================================== */

a, button {
    transition: color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease !important;
}

/* ========================================
   輸入框焦點光暈
======================================== */

.form-group input:focus,
.form-group textarea:focus,
.text-input:focus {
    box-shadow: 
        0 0 0 3px rgba(99,102,241,0.1),
        0 0 16px rgba(99,102,241,0.2) inset !important;
}

/* ========================================
   加強頁尾社交連結動畫
======================================== */

.social-link {
    position: relative;
    overflow: hidden;
}

.social-link::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 30%, rgba(255,255,255,0.15) 50%, transparent 70%);
    transform: translateX(-110%);
    transition: transform 0.5s ease;
}

.social-link:hover::after {
    transform: translateX(110%);
}

/* ========================================
   標籤懸停位移
======================================== */

.tag {
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    position: relative;
}

.tag::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tag:hover::before {
    opacity: 1;
}

/* ========================================
   時間軸項目交錯動畫
======================================== */

.timeline-item {
    animation: fadeInUp 0.6s ease-out both;
}

.timeline-item:nth-child(1) { animation-delay: 0.1s; }
.timeline-item:nth-child(2) { animation-delay: 0.2s; }
.timeline-item:nth-child(3) { animation-delay: 0.3s; }
.timeline-item:nth-child(4) { animation-delay: 0.4s; }
.timeline-item:nth-child(5) { animation-delay: 0.5s; }

/* ========================================
   聯絡表單標籤動畫
======================================== */

.form-group label {
    transition: color 0.3s ease;
}

.form-group input:focus ~ label,
.form-group textarea:focus ~ label,
.form-group input:not(:placeholder-shown) ~ label,
.form-group textarea:not(:placeholder-shown) ~ label {
    color: var(--primary-color);
}

/* ========================================
   進度條動畫 - 無限迴圈
======================================== */

.skill-progress-bar {
    animation: slideRight 1.5s ease-in-out;
}

@keyframes slideRight {
    from { width: 0; opacity: 0; }
    to { width: 100%; opacity: 1; }
}

/* ========================================
   下拉箭頭脈衝
======================================== */

.scroll-indicator span {
    animation: scrollAnimation 1.5s ease-in-out infinite;
}

/* ========================================
   滑來滑去效果 - 段落
======================================== */

.about-description,
.section-description {
    animation: slideInLeft 0.6s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========================================
   反向滑動 - 圖像
======================================== */

.hero-image,
.about-image-wrapper {
    animation: slideInRight 0.6s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ========================================
   認證徽章彩虹脈衝
======================================== */

.achievement-badge.unlocked {
    animation: rainbowGlow 2s ease-in-out infinite;
}

@keyframes rainbowGlow {
    0%, 100% {
        box-shadow: 0 0 15px rgba(99,102,241,0.3);
    }
    25% {
        box-shadow: 0 0 25px rgba(168,85,247,0.3);
    }
    50% {
        box-shadow: 0 0 35px rgba(236,72,153,0.3);
    }
    75% {
        box-shadow: 0 0 25px rgba(245,158,11,0.3);
    }
}

/* ========================================
   懸停時色彩轉變
======================================== */

.project-card:hover .project-title {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   計數器滑動
======================================== */

@keyframes countUp {
    from { 
        opacity: 0;
        transform: translateY(10px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-number {
    animation: countUp 0.6s ease-out;
}

/* ========================================
   響應式設計 - 手機上的優化
======================================== */

@media (max-width: 768px) {
    .btn::before {
        display: none;
    }
    
    .project-card:hover,
    .skill-category:hover,
    .education-card:hover {
        transform: translateY(-8px) !important;
    }
}

/* ========================================
   減少動畫偏好
======================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-on-scroll {
    opacity: 0;
    animation: fadeInUp 0.6s ease forwards;
}

/* ========================================
   自訂滾動條
======================================== */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* ========================================
   選取文字樣式
======================================== */
::selection {
    background: var(--primary-color);
    color: white;
}

::-moz-selection {
    background: var(--primary-color);
    color: white;
}

/* ========================================
   新功能樣式
======================================== */

/* 加載畫面 */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.preloader-content {
    text-align: center;
}

.loader {
    width: 80px;
    height: 80px;
    border: 8px solid var(--border-color);
    border-top: 8px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: var(--text-secondary);
    font-size: 1.2rem;
    font-weight: 500;
}

/* 滾動進度條 */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    z-index: 9998;
    transition: width 0.1s ease;
}

/* 鼠標跟隨效果 */
.cursor-follower {
    position: fixed;
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9997;
    transition: transform 0.15s ease, opacity 0.3s ease;
    opacity: 0;
}

.cursor-follower.active {
    opacity: 1;
    transform: scale(1.5);
}

/* 語言切換按鈕 */
.language-toggle {
    position: fixed;
    top: 170px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--bg-primary);
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
}

.language-toggle:hover {
    background: var(--primary-color);
    transform: scale(1.1);
}

.language-toggle .lang-text {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.9rem;
}

.language-toggle:hover .lang-text {
    color: white;
}

/* 音樂播放器容器和面板 */
.music-player-container {
    position: fixed;
    top: 240px;
    right: 30px;
    z-index: 1000;
}

.music-panel {
    position: absolute;
    top: -180px;
    right: 0;
    width: 200px;
    background: rgba(255,255,255,0.12) !important;
    backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(99,102,241,0.25) !important;
    border-radius: 16px;
    padding: 1rem;
    box-shadow: 0 8px 24px rgba(99,102,241,0.15) !important;
    animation: slideDown 0.3s ease;
}

[data-theme="dark"] .music-panel {
    background: rgba(20,20,35,0.70) !important;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.music-panel-header {
    margin-bottom: 0.8rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid rgba(99,102,241,0.2);
}

.music-panel-header h4 {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
}

.music-scores-container {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.score-btn {
    padding: 0.6rem 1rem;
    background: transparent;
    border: 1.5px solid rgba(99,102,241,0.3);
    color: var(--text-secondary);
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    justify-content: center;
}

.score-btn:hover {
    background: rgba(99,102,241,0.1);
    border-color: rgba(99,102,241,0.5);
    color: var(--primary-color);
}

.score-btn.active {
    background: var(--gradient-hero);
    border-color: rgba(99,102,241,0.8);
    color: white;
    box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}

.score-btn i {
    font-size: 0.9rem;
}

/* 音樂播放器按鈕 */
.music-toggle {
    position: fixed;
    top: 240px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--bg-primary);
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
}

.music-toggle:hover {
    background: var(--primary-color);
    transform: scale(1.1) rotate(15deg);
}

.music-toggle i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.music-toggle:hover i {
    color: white;
}

.music-toggle.playing {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

/* 列印履歷按鈕 */
.print-resume {
    position: fixed;
    top: 310px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--bg-primary);
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
}

.print-resume:hover {
    background: var(--primary-color);
    transform: scale(1.1);
}

.print-resume i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.print-resume:hover i {
    color: white;
}

/* 訪客計數器和時鐘 */
.hero-info {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

.visitor-counter, .live-clock {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    color: var(--text-secondary);
}

.visitor-counter i, .live-clock i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

#visitor-count, #clock-time {
    font-weight: 600;
    color: var(--primary-color);
}

/* 技能雷達圖 */
.skill-radar-section {
    margin-top: 4rem;
    text-align: center;
}

.subsection-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2rem;
}

.radar-chart-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}

/* 打字速度測試遊戲 */
.typing-game {
    background: var(--bg-secondary);
}

.typing-game-content {
    max-width: 900px;
    margin: 0 auto;
}

.game-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-box {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    text-align: center;
    border: 2px solid transparent;
    transition: all var(--transition-base);
}

.stat-box:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.game-area {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

.text-display {
    font-size: 1.3rem;
    line-height: 2;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-bottom: 1.5rem;
    min-height: 150px;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

.text-display .correct {
    color: #10b981;
}

.text-display .incorrect {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.text-display .current {
    background: var(--primary-color);
    color: white;
    padding: 0 2px;
}

.text-input {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    background: var(--bg-secondary);
    color: var(--text-primary);
    resize: none;
    transition: border-color var(--transition-base);
}

.text-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.text-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.game-controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.game-results {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.game-results h3 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

.results-content p {
    font-size: 1.2rem;
    margin: 0.8rem 0;
    color: var(--text-secondary);
}

.results-content strong {
    color: var(--primary-color);
    font-size: 1.5rem;
}

/* 社交分享按鈕 */
.social-share-section {
    margin-top: 3rem;
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    text-align: center;
}

.share-title {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.share-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    color: white;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
}

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.share-btn.facebook {
    background: #1877f2;
}

.share-btn.twitter {
    background: #1da1f2;
}

.share-btn.linkedin {
    background: #0a66c2;
}

.share-btn.whatsapp {
    background: #25d366;
}

.share-btn.copy-link {
    background: var(--text-secondary);
}

/* 成就徽章系統 */
.achievements {
    background: var(--bg-secondary);
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.achievement-badge {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: all var(--transition-base);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.achievement-badge::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(99, 102, 241, 0.1), transparent);
    transform: rotate(45deg);
    transition: all 0.6s ease;
}

.achievement-badge:hover::before {
    left: 100%;
}

.achievement-badge:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-xl);
}

.achievement-badge.locked {
    opacity: 0.6;
    filter: grayscale(100%);
}

.achievement-badge.unlocked {
    animation: badgeUnlock 0.6s ease;
}

@keyframes badgeUnlock {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.badge-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
}

.badge-icon i {
    font-size: 2.5rem;
    color: white;
}

.badge-title {
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.badge-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.badge-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.badge-status.unlocked {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.achievement-badge.locked .badge-status {
    background: rgba(107, 114, 128, 0.1);
    color: var(--text-light);
}

/* 3D卡片傾斜效果 */
.project-card,
.education-card,
.achievement-badge {
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.project-card:hover,
.education-card:hover {
    transform: perspective(1000px) rotateY(5deg) rotateX(5deg);
}

/* 響應式設計 - 新功能 */
@media (max-width: 768px) {
    .language-toggle,
    .music-toggle,
    .print-resume {
        width: 45px;
        height: 45px;
        right: 1rem;
    }
    
    .language-toggle {
        top: 120px;
    }
    
    .music-toggle {
        top: 180px;
    }
    
    .print-resume {
        top: 240px;
    }
    
    .hero-info {
        flex-direction: column;
        gap: 1rem;
    }
    
    .game-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .share-buttons {
        flex-direction: column;
    }
    
    .share-btn {
        width: 100%;
    }
    
    .achievements-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   🚀 性能優化 - Loading & 延遲渲染
======================================== */

/* 關鍵 CSS 優先載入 */
.hero, .nav-menu, .btn-primary {
    font-display: swap;
}

/* 圖片延遲加載 */
img {
    loading: lazy;
}

/* 減少重排 - 固定尺寸容器 */
.image-wrapper {
    width: 400px;
    height: 400px;
    contain: layout style paint;
}

/* ========================================
   ⚡ 加載動畫增強
======================================== */

.preloader-content {
    animation: slideUp 0.8s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.loader {
    animation: spin 0.9s linear infinite;
    filter: drop-shadow(0 0 10px rgba(99,102,241,0.4));
}

.loading-text {
    animation: pulse-text 1.5s ease-in-out infinite;
}

@keyframes pulse-text {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* ========================================
   💡 按鈕狀態完整體驗
======================================== */

.btn-primary,
.btn-secondary,
.btn-submit,
.share-btn {
    position: relative;
    overflow: hidden;
    will-change: transform;
}

/* 按鈕按下效果 */
.btn:active {
    transform: scale(0.95);
}

/* 禁用狀態 */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ========================================
   📱 移動端觸摸優化
======================================== */

@media (hover: none) and (pointer: coarse) {
    .social-link,
    .tag,
    .project-card {
        -webkit-tap-highlight-color: transparent;
    }
    
    .btn:hover {
        transform: none;
    }
    
    .btn:active {
        background: var(--primary-dark) !important;
    }
}

/* ========================================
   🎨 深色模式詳細優化
======================================== */

[data-theme="dark"] {
    color-scheme: dark;
}

[data-theme="dark"] .preloader {
    background: linear-gradient(135deg, #0f172a, #1a1a2e);
}

[data-theme="dark"] .loader {
    border-top-color: #818cf8;
    border-right-color: #8b5cf6;
}

/* ========================================
   📊 表單交互增強
======================================== */

.form-group input,
.form-group textarea,
.text-input {
    caret-color: var(--primary-color);
    font-smoothing: antialiased;
    -webkit-font-smoothing: antialiased;
}

/* 自動填充樣式 */
.form-group input:-webkit-autofill,
.form-group textarea:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px var(--bg-secondary) inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
}

/* ========================================
   🔔 通知和狀態變化
======================================== */

.form-message {
    animation: slideDown 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   ⌨️ 鍵盤焦點指示
======================================== */

*:focus-visible {
    outline: 3px solid var(--primary-color) !important;
    outline-offset: 2px;
}

/* ========================================
   💫 自定義選中文本顏色
======================================== */

::-moz-selection {
    background: rgba(99,102,241,0.5) !important;
    color: var(--text-primary) !important;
}

/* ========================================
   📍 定位優化 - 固定元素
======================================== */

.navbar,
.theme-toggle,
.language-toggle,
.music-toggle,
.print-resume,
.back-to-top,
.scroll-progress {
    position: fixed;
    will-change: transform;
}

/* ========================================
   🖱️ 鼠標懸停優化
======================================== */

@media (hover: hover) {
    .project-card {
        transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
    
    .project-card:hover {
        transform: translateY(-12px) scale(1.02) !important;
    }
    
    .skill-category:hover {
        transform: translateY(-6px) !important;
    }
}

/* ========================================
   🎬 過渡優化 - 減少抖動
======================================== */

* {
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   📝 打字遊戲改進
======================================== */

.text-display {
    font-kerning: auto;
    font-feature-settings: "kern" 1;
    word-break: break-word;
}

.text-input {
    word-break: break-word;
    word-wrap: break-word;
}

/* ========================================
   ⚙️ 性能 - 含量可見性
======================================== */

.project-card,
.skill-category,
.education-card {
    content-visibility: auto;
}

.section {
    contain: layout style paint;
}

/* 列印樣式 */
@media print {
    .navbar,
    .theme-toggle,
    .language-toggle,
    .music-toggle,
    .print-resume,
    .back-to-top,
    .scroll-progress,
    .cursor-follower,
    .preloader,
    .particles-canvas,
    .typing-game,
    .achievements,
    .social-share-section,
    .contact-form,
    .footer {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .section {
        page-break-inside: avoid;
        padding: 1rem 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    #particles-canvas,
    .cursor-follower,
    #three-container,
    .scroll-indicator {
        display: none !important;
    }
}

/* ========================================
   Three.js 3D 背景
======================================== */
#three-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.3;
    pointer-events: none;
}

/* ========================================
   在線狀態指示器
======================================== */
.online-status {
    position: fixed;
    top: 380px;
    right: 30px;
    background: var(--bg-primary);
    padding: 0.8rem 1.2rem;
    border-radius: 30px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    z-index: 999;
    transition: all var(--transition-base);
}

.status-dot {
    width: 12px;
    height: 12px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s infinite;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.status-text {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

/* ========================================
   AI 聊天機器人按鈕和面板
======================================== */
.chatbot-toggle {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: var(--shadow-xl);
    cursor: pointer;
    z-index: 1001;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.chatbot-toggle:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.chatbot-panel {
    position: fixed;
    bottom: 170px;
    right: 30px;
    width: 400px;
    height: 600px;
    background: var(--bg-primary);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 1002;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

@keyframes slideInUp {
    from { opacity: 0; transform: translateY(40px); }
    to   { opacity: 1; transform: translateY(0); }
}

.chatbot-panel.active {
    display: flex;
    animation: slideInUp 0.3s ease;
}

.chatbot-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chatbot-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 1.1rem;
}

.chatbot-actions {
    display: flex;
    gap: 0.5rem;
}

.chatbot-minimize,
.chatbot-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.chatbot-minimize:hover,
.chatbot-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.chatbot-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: var(--bg-secondary);
}

.chatbot-messages {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.chat-message {
    display: flex;
    gap: 0.8rem;
    animation: fadeIn 0.3s ease;
}

.chat-message.user-message {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.message-content {
    background: var(--bg-primary);
    padding: 0.8rem 1.2rem;
    border-radius: 15px;
    max-width: 70%;
    box-shadow: var(--shadow-sm);
}

.user-message .message-content {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
}

.chatbot-quick-questions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.quick-question {
    background: var(--bg-primary);
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all var(--transition-fast);
}

.quick-question:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.chatbot-footer {
    padding: 1rem;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.5rem;
}

#chatbot-input {
    flex: 1;
    padding: 0.8rem;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-size: 0.95rem;
    outline: none;
    transition: all var(--transition-fast);
    background: var(--bg-secondary);
    color: var(--text-primary);
}

#chatbot-input:focus {
    border-color: var(--primary-color);
}

.btn-send {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-send:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

/* ========================================
   互動終端機按鈕和面板
======================================== */
.terminal-toggle {
    position: fixed;
    bottom: 170px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #1a1a1a, #2d2d2d);
    color: #00ff00;
    border: 2px solid #00ff00;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 255, 0, 0.3);
    cursor: pointer;
    z-index: 1001;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.terminal-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 30px rgba(0, 255, 0, 0.5);
}

.terminal-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 800px;
    height: 500px;
    background: #1a1a1a;
    border: 2px solid #00ff00;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 255, 0, 0.3);
    z-index: 1002;
    display: none;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Courier New', monospace;
}

.terminal-panel.active {
    display: flex;
    animation: glitchIn 0.3s ease;
}

.terminal-header {
    background: #2d2d2d;
    color: #00ff00;
    padding: 0.8rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #00ff00;
}

.terminal-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.terminal-actions {
    display: flex;
    gap: 0.5rem;
}

.terminal-minimize,
.terminal-close {
    background: transparent;
    border: 1px solid #00ff00;
    color: #00ff00;
    width: 30px;
    height: 30px;
    border-radius: 5px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.terminal-minimize:hover,
.terminal-close:hover {
    background: #00ff00;
    color: #1a1a1a;
}

.terminal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    color: #00ff00;
    background: #0a0a0a;
}

.terminal-output {
    font-size: 0.95rem;
    line-height: 1.6;
}

.terminal-line {
    margin-bottom: 0.5rem;
    white-space: pre-wrap;
}

.terminal-footer {
    padding: 1rem;
    background: #1a1a1a;
    border-top: 2px solid #00ff00;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.terminal-prompt {
    color: #00ff00;
    font-weight: 600;
}

.terminal-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 0.95rem;
    outline: none;
}

@keyframes glitchIn {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    50% { opacity: 1; transform: translate(-48%, -52%) scale(1.02); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ========================================
   訪客留言板
======================================== */
.guestbook {
    background: var(--bg-secondary);
}

.guestbook-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 3rem;
}

.guestbook-form-container {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow-lg);
}

.guestbook-form-container h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.guestbook-form .form-group {
    margin-bottom: 1.5rem;
}

.guestbook-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.guestbook-form input,
.guestbook-form textarea {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.guestbook-form input:focus,
.guestbook-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.guestbook-messages {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow-lg);
    max-height: 600px;
    overflow-y: auto;
}

.guestbook-messages h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.messages-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message-card {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
    animation: slideInRight 0.3s ease;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.message-author {
    font-weight: 600;
    color: var(--text-primary);
}

.message-date {
    font-size: 0.85rem;
    color: var(--text-light);
}

.message-text {
    color: var(--text-secondary);
    line-height: 1.6;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ========================================
   響應式設計 - 新功能
======================================== */
@media (max-width: 992px) {
    .chatbot-panel {
        width: 350px;
        height: 500px;
    }
    
    .terminal-panel {
        width: 90%;
        height: 70%;
    }
    
    .guestbook-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .online-status {
        top: 120px;
        right: 1rem;
        padding: 0.6rem 1rem;
    }
    
    .chatbot-toggle,
    .terminal-toggle {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .chatbot-toggle {
        bottom: 7rem;
        right: 1rem;
    }
    
    .terminal-toggle {
        bottom: 13rem;
        right: 1rem;
    }
    
    .chatbot-panel {
        width: calc(100% - 2rem);
        height: calc(100vh - 10rem);
        right: 1rem;
        bottom: 8rem;
    }
    
    .terminal-panel {
        width: calc(100% - 2rem);
        height: calc(100vh - 8rem);
    }
}

/* ========================================



/* ========================================
   Glassmorphism & Rich UI — unified block
======================================== */

/* ─── Glass card base ─── */
.glass-card {
    background: rgba(255,255,255,.04) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    border: 1px solid rgba(255,255,255,.10) !important;
    border-radius: 18px !important;
    padding: 2.4rem !important;
    box-shadow: 0 8px 32px rgba(0,0,0,.12) !important;
    transition: transform .4s cubic-bezier(.175,.885,.32,1.275),
                box-shadow .4s ease, border-color .4s ease !important;
    position: relative !important;
    overflow: hidden !important;
}
[data-theme='dark'] .glass-card {
    background: rgba(18,18,28,.5) !important;
    border-color: rgba(255,255,255,.08) !important;
}
.glass-card::before {
    content: '' !important;
    position: absolute !important;
    inset: 0 !important;
    left: -120% !important;
    width: 60% !important;
    background: linear-gradient(105deg,
        transparent 30%, rgba(255,255,255,.06) 50%, transparent 70%) !important;
    transform: skewX(-20deg) !important;
    animation: cardShine 7s infinite !important;
    pointer-events: none !important;
}
@keyframes cardShine {
    0%   { left:-120%; }
    18%  { left: 140%; }
    100% { left: 140%; }
}
.hover-glow { transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease !important; }
.hover-glow:hover {
    transform: translateY(-7px) !important;
    box-shadow: 0 20px 45px rgba(99,102,241,.22) !important;
    border-color: rgba(99,102,241,.40) !important;
    z-index: 2;
}

/* ─── Section spacing helper ─── */
.extra-section {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(128,128,128,.12);
}
.extra-section .subsection-title,
.extra-section .certificates-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.8rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, #818cf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ─── Skill category upgrade ─── */
.skill-category {
    background: rgba(255,255,255,.03) !important;
    backdrop-filter: blur(10px) !important;
    border-radius: 18px !important;
    padding: 2rem !important;
    border: 1px solid rgba(255,255,255,.06) !important;
    transition: all .4s ease !important;
    position: relative;
    overflow: hidden;
}
.skill-category:hover {
    transform: translateY(-6px) !important;
    box-shadow: 0 12px 32px rgba(0,0,0,.12) !important;
    border-color: rgba(99,102,241,.30) !important;
}
[data-theme='dark'] .skill-category {
    background: rgba(20,20,30,.55) !important;
    border-color: rgba(255,255,255,.05) !important;
}

/* ─── Tech icon grid (skills page) ─── */
.tech-icons-rich {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 1.2rem;
    margin-top: .5rem;
}
.tech-icon-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .6rem;
    padding: 1.4rem .8rem;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 16px;
    cursor: default;
    transition: all .3s ease;
}
.tech-icon-card:hover {
    transform: translateY(-6px) scale(1.05);
    background: rgba(99,102,241,.08);
    border-color: rgba(99,102,241,.3);
    box-shadow: 0 10px 25px rgba(99,102,241,.15);
}
.tech-icon-card i, .tech-icon-card .tech-emoji {
    font-size: 2.2rem;
    color: var(--primary-color);
    transition: transform .3s ease;
}
.tech-icon-card:hover i, .tech-icon-card:hover .tech-emoji { transform: rotate(8deg) scale(1.2); }
.tech-icon-card span {
    font-size: .78rem;
    font-weight: 500;
    opacity: .75;
    text-align: center;
}
[data-theme='dark'] .tech-icon-card {
    background: rgba(30,30,45,.5);
    border-color: rgba(255,255,255,.06);
}

/* ─── Learning card (skills page) ─── */
.learning-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}
.learning-item {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: 1rem 1.2rem;
    background: rgba(99,102,241,.07);
    border: 1px solid rgba(99,102,241,.18);
    border-radius: 12px;
    transition: all .3s ease;
}
.learning-item:hover {
    background: rgba(99,102,241,.13);
    transform: translateX(6px);
}
.learning-item i { font-size: 1.3rem; color: var(--primary-color); }
.learning-item span { font-size: .9rem; font-weight: 500; }

/* ─── Career metric banner (experience page) ─── */
.career-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}
.career-metric {
    text-align: center;
    padding: 1.8rem 1rem;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 18px;
    transition: all .35s ease;
}
.career-metric:hover {
    transform: translateY(-5px);
    border-color: rgba(99,102,241,.3);
    box-shadow: 0 10px 28px rgba(99,102,241,.15);
}
.career-metric-number {
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: .5rem;
}
.career-metric-label {
    font-size: .85rem;
    opacity: .65;
    font-weight: 500;
}
[data-theme='dark'] .career-metric { background: rgba(20,20,30,.55); }

/* ─── About services grid ─── */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.6rem;
    margin-top: 1rem;
}
.service-card {
    padding: 2rem 1.5rem;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 18px;
    transition: all .35s ease;
    cursor: default;
}
.service-card:hover {
    transform: translateY(-7px);
    border-color: rgba(99,102,241,.35);
    box-shadow: 0 15px 35px rgba(99,102,241,.15);
}
.service-card-icon {
    width: 52px; height: 52px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary-color), #818cf8);
    margin-bottom: 1.2rem;
    font-size: 1.4rem;
    color: #fff;
}
.service-card h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: .5rem;
}
.service-card p {
    font-size: .85rem;
    opacity: .65;
    line-height: 1.6;
}
[data-theme='dark'] .service-card { background: rgba(20,20,30,.55); }

/* ─── Achievements progress section ─── */
.achievements-progress-bar {
    margin-bottom: 2.5rem;
    padding: 1.8rem 2rem;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 18px;
}
.achievements-progress-bar h4 {
    font-size: .95rem;
    font-weight: 600;
    margin-bottom: 1rem;
    opacity: .75;
}
.ach-progress-track {
    height: 10px;
    background: rgba(128,128,128,.2);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: .6rem;
}
.ach-progress-fill {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, var(--primary-color), #818cf8);
    transition: width 1.2s cubic-bezier(.25,.46,.45,.94);
}
.ach-progress-label {
    font-size: .8rem;
    opacity: .6;
}
[data-theme='dark'] .achievements-progress-bar { background: rgba(20,20,30,.55); }

/* ─── typing-game difficulty ─── */
.difficulty-selector {
    display: flex;
    gap: .8rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 1.5rem;
}
.diff-btn {
    padding: .5rem 1.4rem;
    border-radius: 24px;
    border: 2px solid rgba(128,128,128,.25);
    background: transparent;
    color: var(--text-primary);
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .25s ease;
}
.diff-btn:hover { border-color: var(--primary-color); color: var(--primary-color); }
.diff-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 14px rgba(99,102,241,.35);
}

.best-score-display {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 1rem 0 1.5rem;
    flex-wrap: wrap;
}
.best-score-item {
    text-align: center;
    padding: .8rem 1.5rem;
    background: rgba(99,102,241,.08);
    border: 1px solid rgba(99,102,241,.2);
    border-radius: 12px;
}
.best-score-item .label { font-size: .75rem; opacity: .6; margin-bottom: .3rem; }
.best-score-item .value { font-size: 1.4rem; font-weight: 800; color: var(--primary-color); }

/* ─── Tips card (typing game) ─── */
.tips-card {
    margin-top: 2rem;
    padding: 1.6rem;
    background: rgba(16,185,129,.06);
    border: 1px solid rgba(16,185,129,.2);
    border-radius: 16px;
}
.tips-card h4 { font-size: .95rem; font-weight: 700; color: #10b981; margin-bottom: .8rem; }
.tips-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: .5rem;
    list-style: none; padding: 0;
}
.tips-list li {
    display: flex; align-items: flex-start; gap: .5rem;
    font-size: .82rem; opacity: .75; line-height: 1.4;
}
.tips-list li::before { content: '→'; color: #10b981; flex-shrink: 0; }

/* ─── Certificates grid upgrade ─── */
.certificate-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 1.4rem;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 14px;
    transition: all .3s ease;
}
.certificate-item:hover {
    transform: translateX(6px);
    border-color: rgba(99,102,241,.30);
    background: rgba(99,102,241,.07);
}
.certificate-item i {
    font-size: 1.6rem;
    color: var(--primary-color);
    flex-shrink: 0;
}
[data-theme='dark'] .certificate-item { background: rgba(20,20,30,.55); }

/* ─── feature-list (utility) ─── */
.feature-list { list-style: none; padding: 0; margin-top: 1.5rem; }
.feature-list li {
    display: flex; align-items: center;
    margin-bottom: 1rem; padding: 1rem;
    background: rgba(128,128,128,.05);
    border-radius: 12px;
    transition: all .3s ease;
}
.feature-list li i { color: var(--primary-color); margin-right: 14px; font-size: 1.1rem; }
.feature-list li:hover { transform: translateX(8px); background: rgba(128,128,128,.1); }

/* ─── Projects filter bar ─── */
.projects-filter {
    display: flex;
    flex-wrap: wrap;
    gap: .7rem;
    justify-content: center;
    margin-bottom: 2.5rem;
}
.filter-btn {
    padding: .45rem 1.3rem;
    border-radius: 24px;
    border: 1.5px solid rgba(128,128,128,.25);
    background: transparent;
    color: var(--text-primary);
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .25s ease;
}
.filter-btn:hover { border-color: var(--primary-color); color: var(--primary-color); }
.filter-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 14px rgba(99,102,241,.3);
}
.project-card { transition: all .4s ease; }
.project-card.hidden { display: none; }

/* ─── Responsive tweaks ─── */
@media (max-width: 768px) {
    .tech-icons-rich { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
    .career-metrics { grid-template-columns: repeat(2, 1fr); }
    .services-grid { grid-template-columns: 1fr; }
    .learning-grid { grid-template-columns: 1fr; }
}

/* ========================================
   ✨ UI Polish & Visual Enhancements
======================================== */

/* ── Extra colour tokens ── */
:root {
    --glow-primary: rgba(99,102,241,0.55);
    --glow-secondary: rgba(245,158,11,0.45);
    --gradient-hero: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    --gradient-warm: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    --mesh-1: radial-gradient(ellipse 80% 80% at 20% 20%, rgba(99,102,241,0.13) 0%, transparent 60%);
    --mesh-2: radial-gradient(ellipse 60% 60% at 80% 80%, rgba(236,72,153,0.10) 0%, transparent 60%);
    --mesh-3: radial-gradient(ellipse 50% 50% at 50% 10%,  rgba(245,158,11,0.08) 0%, transparent 55%);
}
[data-theme="dark"] {
    --mesh-1: radial-gradient(ellipse 80% 80% at 20% 20%, rgba(99,102,241,0.18) 0%, transparent 60%);
    --mesh-2: radial-gradient(ellipse 60% 60% at 80% 80%, rgba(236,72,153,0.14) 0%, transparent 60%);
    --mesh-3: radial-gradient(ellipse 50% 50% at 50% 10%,  rgba(245,158,11,0.10) 0%, transparent 55%);
}

/* ── Mesh-gradient hero background ── */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--mesh-1), var(--mesh-2), var(--mesh-3);
    pointer-events: none;
    z-index: 0;
}
.hero .container { position: relative; z-index: 1; }

/* ── Even sections mesh tint ── */
.section:nth-child(even)::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--mesh-1);
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
}
.section:nth-child(even) .container { position: relative; z-index: 1; }

/* ── Beautiful preloader ── */
.preloader {
    background: var(--bg-primary) !important;
}
.preloader::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--mesh-1), var(--mesh-2);
}
.preloader-content {
    position: relative;
    z-index: 1;
}
.loader {
    width: 70px !important;
    height: 70px !important;
    border: 3px solid transparent !important;
    border-top-color: #6366f1 !important;
    border-right-color: #8b5cf6 !important;
    border-radius: 50% !important;
    animation: spin 0.9s linear infinite !important;
    box-shadow: 0 0 22px rgba(99,102,241,0.35) !important;
    margin-bottom: 1.5rem !important;
}
.loader::after {
    content: '';
    position: absolute;
    inset: 6px;
    border: 3px solid transparent;
    border-bottom-color: #ec4899;
    border-left-color: #f59e0b;
    border-radius: 50%;
    animation: spin 1.3s linear infinite reverse;
}
.loading-text {
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600 !important;
    font-size: 1rem !important;
    letter-spacing: 1px;
}

/* ── Gradient section titles ── */
.section-title {
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.section-divider {
    width: 60px !important;
    height: 4px !important;
    background: var(--gradient-hero) !important;
    border-radius: 4px !important;
    box-shadow: 0 0 10px var(--glow-primary);
}

/* ── Navbar glassmorphism ── */
.navbar {
    background: rgba(255,255,255,0.75) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border-bottom: 1px solid rgba(99,102,241,0.12) !important;
    box-shadow: 0 2px 24px rgba(99,102,241,0.08) !important;
}
[data-theme="dark"] .navbar {
    background: rgba(17,24,39,0.80) !important;
    border-bottom-color: rgba(255,255,255,0.06) !important;
}
.navbar.scrolled {
    box-shadow: 0 4px 30px rgba(99,102,241,0.15) !important;
}
.logo-text {
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Gradient primary button with shimmer ── */
.btn-primary {
    background: var(--gradient-hero) !important;
    border: none !important;
    box-shadow: 0 4px 18px var(--glow-primary) !important;
    position: relative;
    overflow: hidden;
}
.btn-primary::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -80%;
    width: 50%;
    height: 200%;
    background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,0.25) 50%, transparent 70%);
    transform: skewX(-20deg);
    transition: left 0.5s ease;
}
.btn-primary:hover::after { left: 130%; }
.btn-primary:hover {
    box-shadow: 0 8px 28px var(--glow-primary) !important;
    transform: translateY(-3px) !important;
}

/* ── Secondary button improved ── */
.btn-secondary {
    border: 2px solid transparent !important;
    background: linear-gradient(var(--bg-primary), var(--bg-primary)) padding-box,
                var(--gradient-hero) border-box !important;
    color: var(--primary-color) !important;
}
.btn-secondary:hover {
    background: var(--gradient-hero) !important;
    color: white !important;
    box-shadow: 0 6px 22px var(--glow-primary) !important;
}

/* ── Hero title gradient highlight ── */
.hero-title .highlight {
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-title .highlight::after { display: none; }

/* ── Profile image glowing ring ── */
.image-wrapper::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: var(--gradient-hero);
    z-index: -1;
    filter: blur(10px);
    opacity: 0.35;
    animation: ringPulse 3s ease-in-out infinite;
}
@keyframes ringPulse {
    0%, 100% { opacity: 0.3; filter: blur(10px); }
    50%       { opacity: 0.5; filter: blur(14px); }
}
.profile-image {
    border: 4px solid transparent !important;
    background: linear-gradient(var(--bg-primary), var(--bg-primary)) padding-box,
                var(--gradient-hero) border-box !important;
}

/* ── Hero subtitle gradient ── */
.hero-subtitle {
    background: linear-gradient(90deg, var(--secondary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.cursor {
    -webkit-text-fill-color: var(--secondary-color) !important;
}

/* ── Hero info glassmorphism pill ── */
.hero-info {
    background: rgba(255,255,255,0.08) !important;
    backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(99,102,241,0.20) !important;
    border-radius: 14px !important;
    box-shadow: 0 4px 18px rgba(99,102,241,0.08) !important;
}
[data-theme="dark"] .hero-info {
    background: rgba(30,30,50,0.45) !important;
}
#visitor-count, #clock-time {
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Social links colour on hover ── */
.social-link:hover {
    background: var(--gradient-hero) !important;
    box-shadow: 0 6px 18px var(--glow-primary) !important;
}

/* ── Skill progress bar gradient glow ── */
.skill-progress-bar {
    background: var(--gradient-hero) !important;
    box-shadow: 0 0 8px var(--glow-primary);
}

/* ── Timeline icon & date gradient ── */
.timeline-icon {
    background: var(--gradient-hero) !important;
    box-shadow: 0 0 18px var(--glow-primary) !important;
}
.timeline-date {
    background: var(--gradient-hero) !important;
}
.timeline::before {
    background: linear-gradient(180deg, #6366f1, #8b5cf6, #ec4899) !important;
}

/* ── Contact icon gradient ── */
.contact-icon {
    background: var(--gradient-hero) !important;
    box-shadow: 0 4px 14px var(--glow-primary) !important;
}

/* ── Contact form glass card ── */
.contact-form {
    background: rgba(255,255,255,0.06) !important;
    backdrop-filter: blur(16px) !important;
    border: 1px solid rgba(99,102,241,0.18) !important;
    border-radius: 20px !important;
    box-shadow: 0 12px 40px rgba(99,102,241,0.10) !important;
}
[data-theme="dark"] .contact-form {
    background: rgba(20,20,35,0.55) !important;
}
.form-group input:focus,
.form-group textarea:focus {
    border-color: transparent !important;
    background: linear-gradient(var(--bg-secondary), var(--bg-secondary)) padding-box,
                var(--gradient-hero) border-box !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12) !important;
}
.form-title {
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.btn-submit {
    background: var(--gradient-hero) !important;
    box-shadow: 0 6px 20px var(--glow-primary) !important;
    position: relative;
    overflow: hidden;
}
.btn-submit::after {
    content: '';
    position: absolute;
    top: -50%; left: -80%;
    width: 50%; height: 200%;
    background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,0.22) 50%, transparent 70%);
    transform: skewX(-20deg);
    transition: left 0.5s ease;
}
.btn-submit:hover::after { left: 130%; }
.btn-submit:hover {
    box-shadow: 0 10px 30px var(--glow-primary) !important;
}

/* ── Footer gradient top border ── */
.footer {
    border-top: 3px solid transparent;
    background: linear-gradient(var(--bg-dark), var(--bg-dark)) padding-box,
                var(--gradient-hero) border-box !important;
}
.footer-bottom {
    border-top: 1px solid rgba(99,102,241,0.2) !important;
}

/* ── Scroll progress bar gradient ── */
.scroll-progress {
    background: var(--gradient-hero) !important;
    box-shadow: 0 0 8px var(--glow-primary);
}

/* ── Theme / language / music toggles unified style ── */
.theme-toggle,
.language-toggle,
.music-toggle,
.print-resume {
    background: rgba(255,255,255,0.10) !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(99,102,241,0.25) !important;
    box-shadow: 0 4px 16px rgba(99,102,241,0.12) !important;
    transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1) !important;
}
.theme-toggle { background: var(--gradient-hero) !important; border: none !important; }
.theme-toggle:hover,
.language-toggle:hover,
.music-toggle:hover,
.print-resume:hover {
    transform: scale(1.15) !important;
    box-shadow: 0 8px 24px var(--glow-primary) !important;
    border-color: rgba(99,102,241,0.6) !important;
}
[data-theme="dark"] .language-toggle,
[data-theme="dark"] .music-toggle,
[data-theme="dark"] .print-resume {
    background: rgba(20,20,35,0.65) !important;
}

/* ── Back-to-top gradient ── */
.back-to-top {
    background: var(--gradient-hero) !important;
    box-shadow: 0 4px 18px var(--glow-primary) !important;
    border: none !important;
}
.back-to-top:hover {
    transform: translateY(-6px) !important;
    box-shadow: 0 10px 28px var(--glow-primary) !important;
}

/* ── Online status pill ── */
.online-status {
    background: rgba(255,255,255,0.10) !important;
    backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(16,185,129,0.30) !important;
    box-shadow: 0 4px 16px rgba(16,185,129,0.12) !important;
}
[data-theme="dark"] .online-status {
    background: rgba(20,20,35,0.60) !important;
}

/* ── Education icon gradient ── */
.education-icon {
    background: var(--gradient-hero) !important;
    box-shadow: 0 6px 18px var(--glow-primary) !important;
}

/* ── Achievement badge icon gradient ── */
.badge-icon {
    background: var(--gradient-hero) !important;
    box-shadow: 0 6px 20px var(--glow-primary) !important;
}

/* ── Section header sub-gradient ── */
.section-description {
    max-width: 640px;
}

/* ── Custom scrollbar gradient thumb ── */
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #6366f1, #8b5cf6) !important;
    border-radius: 6px;
}

/* ── Selection gradient ── */
::selection {
    background: rgba(99,102,241,0.4) !important;
    color: var(--text-primary) !important;
}

/* ── Chatbot & terminal toggle gradient ── */
.chatbot-toggle {
    box-shadow: 0 6px 24px rgba(102,126,234,0.45) !important;
}
.chatbot-toggle:hover {
    box-shadow: 0 10px 32px rgba(102,126,234,0.60) !important;
}

/* ── Card hover: drop unified glow ── */
.skill-category:hover,
.education-card:hover,
.achievement-badge:hover {
    box-shadow: 0 16px 42px rgba(99,102,241,0.18) !important;
}

/* ── Share buttons refined ── */
.share-btn {
    border-radius: 12px !important;
    font-weight: 600 !important;
    letter-spacing: 0.3px;
    transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1) !important;
}
.share-btn:hover {
    transform: translateY(-4px) scale(1.04) !important;
    filter: brightness(1.1);
}

/* ── Form-message polished ── */
.form-message.success {
    background: linear-gradient(135deg, rgba(16,185,129,0.12), rgba(16,185,129,0.06)) !important;
    border: 1px solid rgba(16,185,129,0.30) !important;
    color: #059669 !important;
    border-radius: 12px !important;
}
.form-message.error {
    background: linear-gradient(135deg, rgba(239,68,68,0.12), rgba(239,68,68,0.06)) !important;
    border: 1px solid rgba(239,68,68,0.30) !important;
    border-radius: 12px !important;
}

/* ── Newsletter form ── */
.newsletter-form input {
    border-radius: 25px 0 0 25px !important;
    border: 1px solid rgba(99,102,241,0.20) !important;
}
.newsletter-form button {
    background: var(--gradient-hero) !important;
    border-radius: 0 25px 25px 0 !important;
}

/* ── Stat number gradient ── */
.stat-number {
    background: var(--gradient-hero);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Tag hover glow ── */
.tag:hover {
    box-shadow: 0 4px 14px rgba(99,102,241,0.30) !important;
}

/* ── Scroll indicator gradient ── */
.scroll-indicator span {
    background: var(--gradient-hero) !important;
}

/* ── Section alt-bg refined ── */
.section:nth-child(even) {
    background: var(--bg-secondary) !important;
}

/* ── Responsive polish ── */
@media (max-width: 768px) {
    .hero::before { opacity: 0.7; }
    .image-wrapper::before { filter: blur(12px); }
}
