@font-face {
    font-family: '粉圓';
    src: url('https://cdn.jsdelivr.net/gh/justfont/open-huninn-font@2.1/font/jf-openhuninn-2.1.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

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

body {
    background-color: #0f172a;
    color: #f8fafc;
    overflow-x: hidden;
    font-family: '粉圓', 'jf open 粉圓', 'Noto Sans TC', 'Microsoft JhengHei', '微軟正黑體', 'PingFang TC', 'Hiragino Sans GB', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    display: flex;
}

.gradient-text {
    background: linear-gradient(90deg, #38bdf8, #818cf8, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    background-size: 200% auto;
    animation: textShine 3s ease-in-out infinite alternate;
}

@keyframes textShine {
    0% {
        background-position: 0% center;
    }

    100% {
        background-position: 100% center;
    }
}

.hero-bg {
    background: radial-gradient(circle at 50% 50%, rgba(56, 189, 248, 0.15) 0%, rgba(30, 64, 175, 0.05) 50%, rgba(15, 23, 42, 0) 100%);
}

.card {
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.floating {
    animation: floating 3s ease-in-out infinite;
}

@keyframes floating {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-15px);
    }

    100% {
        transform: translateY(0px);
    }
}

.scroll-indicator {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #38bdf8, #818cf8, #c084fc);
    z-index: 9999;
    transition: width 0.1s ease;
}

/* 側邊欄樣式 */
.sidebar {
    width: 250px;
    height: 100vh;
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(15px);
    position: fixed;
    top: 0;
    left: 0;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
    z-index: 100;
    transition: all 0.3s ease;
    animation: slideIn 0.8s ease forwards;
    border-right: 1px solid rgba(56, 189, 248, 0.2);
}

.sidebar.collapsed {
    width: 80px;
}

.sidebar-header {
    padding: 20px;
    text-align: left;
    border-bottom: 1px solid rgba(56, 189, 248, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
}

.sidebar.collapsed .sidebar-header {
    padding: 20px 10px;
    text-align: center;
}

.sidebar-header h3 {
    color: #38bdf8;
    margin: 0;
    font-size: 24px;
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
    font-weight: 700;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 20px;
}

.sidebar-header h3 i {
    font-size: 24px;
    transition: all 0.3s ease;
}

.sidebar-header h3 .header-text {
    transition: all 0.3s ease;
    overflow: hidden;
}

.sidebar-header:hover {
    background: rgba(56, 189, 248, 0.1);
}

.sidebar.collapsed .sidebar-header h3 {
    font-size: 24px;
    opacity: 1;
    justify-content: center;
    gap: 0;
}

.sidebar.collapsed .sidebar-header h3 .header-text {
    width: 0;
    opacity: 0;
}

.nav-links {
    list-style: none;
    padding: 20px 0;
    margin: 0;
}

.nav-links li {
    margin-bottom: 10px;
}

.nav-links a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: #cbd5e1;
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 10px;
    margin: 0 10px;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.sidebar.collapsed .nav-links a {
    padding: 15px;
    justify-content: center;
    margin: 0 5px;
}

.nav-links a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.2), transparent);
    transition: all 0.5s ease;
}

.nav-links a:hover::before {
    left: 100%;
}

.nav-links a i {
    margin-right: 12px;
    font-size: 18px;
    color: #38bdf8;
    transition: all 0.3s ease;
    min-width: 18px;
}

.sidebar.collapsed .nav-links a i {
    margin-right: 0;
}

.nav-links a .nav-text {
    transition: all 0.3s ease;
    overflow: hidden;
}

.sidebar.collapsed .nav-links a .nav-text {
    width: 0;
    opacity: 0;
}

.nav-links a:hover,
.nav-links a.active {
    background: rgba(56, 189, 248, 0.1);
    color: #38bdf8;
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(56, 189, 248, 0.2);
}

.sidebar.collapsed .nav-links a:hover,
.sidebar.collapsed .nav-links a.active {
    transform: scale(1.1);
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(0);
    }
}

/* 主內容區域 */
.content {
    flex: 1;
    margin-left: 250px;
    position: relative;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.content.sidebar-collapsed {
    margin-left: 80px;
}

/* 頁面樣式 */
.page {
    display: none;
    padding: 40px;
    min-height: 100vh;
}

.page.active {
    display: block;
    animation: fadeInFromBottom 0.8s ease forwards;
}

.page-content {
    background: rgba(30, 41, 59, 0.3);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(56, 189, 248, 0.1);
    max-width: 1200px;
    margin: 0 auto;
}

@keyframes fadeInFromBottom {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 首頁標題樣式 */
.home-title {
    text-align: center;
    margin-bottom: 30px;
}

.home-title h2 {
    display: inline;
    color: #f8fafc;
    font-family: '粉圓', 'jf open 粉圓', 'Noto Sans TC', 'Microsoft JhengHei', '微軟正黑體', 'PingFang TC', 'Hiragino Sans GB', sans-serif;
    font-size: 2.5rem;
    margin: 0;
    letter-spacing: 1px;
    text-shadow: 0 0 15px rgba(56, 189, 248, 0.3);
}

.home-title h1 {
    display: inline;
    margin: 0 0 0 15px;
    font-family: '粉圓', 'jf open 粉圓', 'Noto Sans TC', 'Microsoft JhengHei', '微軟正黑體', 'PingFang TC', 'Hiragino Sans GB', sans-serif;
    font-size: 3.5rem;
    letter-spacing: 2px;
    text-shadow: 0 0 20px rgba(56, 189, 248, 0.5);
    background: linear-gradient(90deg, #38bdf8, #818cf8, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    background-size: 200% auto;
    animation: textShine 3s ease-in-out infinite alternate;
}

h1 {
    margin-top: 0;
    color: #f8fafc;
    text-align: center;
    font-family: '粉圓', 'jf open 粉圓', 'Noto Sans TC', 'Microsoft JhengHei', '微軟正黑體', 'PingFang TC', 'Hiragino Sans GB', sans-serif;
    font-size: 3.5rem;
    margin-bottom: 10px;
    letter-spacing: 2px;
    text-shadow: 0 0 20px rgba(56, 189, 248, 0.5);
}

h2 {
    color: #f8fafc;
    text-align: center;
    font-size: 2.5rem;
    font-family: '粉圓', 'jf open 粉圓', 'Noto Sans TC', 'Microsoft JhengHei', '微軟正黑體', 'PingFang TC', 'Hiragino Sans GB', sans-serif;
    margin-top: 0;
    margin-bottom: 30px;
    letter-spacing: 1px;
    text-shadow: 0 0 15px rgba(56, 189, 248, 0.3);
}

.self {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.self p {
    color: #cbd5e1;
    text-align: center;
    font-weight: 500;
    font-size: 1.2rem;
    line-height: 1.8;
    max-width: 600px;
}

.img1 {
    justify-content: center;
    align-items: center;
    display: flex;
    margin: 30px 0;
}

.img1 img {
    max-width: 500px;
    width: 75%;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    border: 2px solid rgba(56, 189, 248, 0.3);
}

.img1 img:hover {
    transform: scale(1.05) rotateY(5deg);
    box-shadow: 0 25px 50px rgba(56, 189, 248, 0.2);
    animation: floating 2s ease-in-out infinite;
}

/* 社交媒體連結 */
.social-links {
    margin: 30px 0;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.social-links li {
    list-style: none;
}

.social-links li a {
    position: relative;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 50%;
    text-decoration: none;
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(56, 189, 248, 0.3);
    transition: all 0.3s ease;
    overflow: hidden;
}

.social-links li a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.3), transparent);
    transition: all 0.5s ease;
}

.social-links li a:hover::before {
    left: 100%;
}

.social-links li a:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 10px 20px rgba(56, 189, 248, 0.3);
    border-color: #38bdf8;
}

.social-links li a .fab {
    font-size: 24px;
    color: #cbd5e1;
    transition: all 0.3s ease;
    z-index: 1;
}

.social-links li:nth-child(1) a:hover .fab {
    color: #c4302b;
}

.social-links li:nth-child(2) a:hover .fab {
    color: #6441a5;
}

.social-links li:nth-child(3) a:hover .fab {
    color: #ffffff;
}

/* 神秘連結樣式 */
.mystery-link-container {
    text-align: center;
    margin-top: 20px;
}

.mystery-link {
    color: #515d6d;
    text-decoration: none;
    font-family: '粉圓', 'jf open 粉圓', 'Noto Sans TC', 'Microsoft JhengHei', '微軟正黑體', 'PingFang TC', 'Hiragino Sans GB', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    padding: 8px 8px;
    display: block;
}

.contact {
    text-align: center;
}

.link {
    display: inline-block;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
    gap: 15px;
}

.message-link {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 10px 15px;
    border-radius: 10px;
}

.message-link:hover {
    background: rgba(56, 189, 248, 0.1);
    transform: translateY(-2px);
}

.message-link i {
    color: #38bdf8;
    font-size: 2rem;
    transition: all 0.3s ease;
}

.message-link:hover i {
    transform: scale(1.1);
    color: #60a5fa;
}

.message-text {
    color: #f8fafc;
    font-family: '粉圓', 'jf open 粉圓', 'Noto Sans TC', 'Microsoft JhengHei', '微軟正黑體', 'PingFang TC', 'Hiragino Sans GB', sans-serif;
    font-weight: 500;
    font-size: 1.2rem;
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
    transition: all 0.3s ease;
}

.message-link:hover .message-text {
    color: #60a5fa;
}

/* 粒子背景 */
.particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(56, 189, 248, 0.3);
    pointer-events: none;
    animation: particleFloat 6s ease-in-out infinite;
}

@keyframes particleFloat {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.1;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .sidebar {
        width: 200px;
        /* 從 250px 改為 200px */
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .content {
        margin-left: 0;
    }

    .page {
        padding: 20px;
    }

    .page-content {
        padding: 20px;
        min-width: 320px;
        /* 確保最小寬度 */
        width: 100%;
        max-width: none;
        /* 移除最大寬度限制 */
    }

    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 2rem;
    }

    .img1 img {
        width: 90%;
    }

    /* 修正主頁面標題在手機上的顯示 */
    .home-title h2 {
        font-size: 1.8rem;
    }

    .home-title h1 {
        font-size: 2.5rem;
    }

    /* 確保聯絡我頁面的寬度 */
    .contact {
        width: 100%;
        min-width: 280px;
    }

    .message-link {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .social-links {
        flex-wrap: wrap;
        gap: 15px;
    }

    /* 移除移動端菜單按鈕的重複創建 */
    .mobile-menu-btn {
        display: none !important;
    }
}

/* 暗黑模式切換開關 */
.theme-toggle-container {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: flex-start;
    transition: all 0.3s ease;
}

.sidebar.collapsed .theme-toggle-container {
    left: 10px;
    right: 10px;
    justify-content: center;
}

.theme-toggle {
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 18px;
}

.theme-toggle:hover {
    transform: rotate(45deg) scale(1.1);
    background: rgba(56, 189, 248, 0.2);
    box-shadow: 0 5px 15px rgba(56, 189, 248, 0.3);
}

/* 淺色模式樣式 */
.light-mode {
    background-color: #f8fafc;
    color: #0f172a;
}

.light-mode .sidebar {
    background: rgba(241, 245, 249, 0.8);
    border-right: 1px solid rgba(15, 23, 42, 0.2);
}

.light-mode .sidebar-header {
    border-bottom: 1px solid rgba(15, 23, 42, 0.2);
}

.light-mode .sidebar-header h3 {
    color: #1e40af;
    text-shadow: 0 0 10px rgba(30, 64, 175, 0.5);
}

.light-mode .nav-links a {
    color: #475569;
}

.light-mode .nav-links a i {
    color: #1e40af;
}

.light-mode .nav-links a:hover,
.light-mode .nav-links a.active {
    background: rgba(30, 64, 175, 0.1);
    color: #1e40af;
}

.light-mode .page-content {
    background: rgba(241, 245, 249, 0.7);
    border: 1px solid rgba(15, 23, 42, 0.1);
}

.light-mode .card {
    background: rgba(241, 245, 249, 0.7);
    border: 1px solid rgba(15, 23, 42, 0.1);
}

.light-mode .card:hover {
    border: 1px solid rgba(30, 64, 175, 0.5);
}

.light-mode .self p {
    color: #475569;
}

.light-mode .message-link:hover {
    background: rgba(30, 64, 175, 0.1);
}

.light-mode .message-link i {
    color: #1e40af;
}

.light-mode .message-link:hover i {
    color: #3b82f6;
}

.light-mode .message-text {
    color: #0f172a;
    text-shadow: 0 0 10px rgba(15, 23, 42, 0.3);
}

.light-mode .message-link:hover .message-text {
    color: #3b82f6;
}

.light-mode .social-links li a {
    background: rgba(241, 245, 249, 0.5);
    border: 1px solid rgba(30, 64, 175, 0.3);
}

.light-mode .social-links li a .fab {
    color: #475569;
}

.light-mode .social-links li a:hover {
    border-color: #1e40af;
    box-shadow: 0 10px 20px rgba(30, 64, 175, 0.3);
}

.light-mode .social-links li:nth-child(3) a:hover .fab {
    color: #000000;
}

.light-mode .mystery-link {
    color: #b7c3d4;
}

.light-mode .theme-toggle {
    background: rgba(30, 64, 175, 0.1);
    border: 1px solid rgba(30, 64, 175, 0.3);
    color: #000000;
}

.light-mode .theme-toggle:hover {
    background: rgba(30, 64, 175, 0.2);
    box-shadow: 0 5px 15px rgba(30, 64, 175, 0.3);
}

.light-mode h1:not(.gradient-text) {
    color: #0f172a;
    text-shadow: 0 0 20px rgba(15, 23, 42, 0.5);
}

.light-mode h2:not(.gradient-text) {
    color: #0f172a;
    text-shadow: 0 0 15px rgba(15, 23, 42, 0.3);
}

.light-mode .home-title h2 {
    color: #0f172a;
    text-shadow: 0 0 15px rgba(15, 23, 42, 0.3);
}