@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;700&display=swap');

/* Reset & Basic Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --black-1: #000000;  /* 最深 */
    --black-2: #0a0a0a;  /* 深 */
    --black-3: #111111;  /* 中 */
    --black-4: #141414;  /* 淺 */
    --black-5: #1a1a1a;  /* 最淺 */
    --text-color: #ffffff;
    --accent-color: #ffd700;
    --secondary-color: #ffb300;
    --hover-color: #ffe666; /* 懸停時的高亮顏色 */
}

html {
    scrollbar-width: none; /* 隱藏滾動條 - 適用於 Firefox */
    -ms-overflow-style: none; /* 隱藏滾動條 - 適用於 Internet Explorer 和 Edge */
}

html::-webkit-scrollbar {
    display: none; /* 隱藏滾動條 - 適用於 Chrome、Safari 和 Opera */
}

body {
    font-family: 'Noto Sans TC', sans-serif; /* 設置字體為 Noto Sans TC */
    line-height: 1.6; /* 設置行高 */
    background-color: var(--black-1); /* 設置背景顏色為黑色系的最深色 */
    color: var(--text-color); /* 設置文字顏色為白色 */
    overflow-x: hidden; /* 禁止水平滾動 */
    overflow-y: scroll; /* 確保頁面可以垂直滾動 */
    -webkit-overflow-scrolling: touch; /* 在 iOS 上保持滾動的流暢性 */
}

a {
    text-decoration: none; /* 移除超連結的下劃線 */
}

/* 區塊樣式 */
section {
    width: 100%; /* 區塊寬度佔滿整個頁面 */
    min-height: 100vh; /* 區塊最小高度為一個視窗高度 */
    display: flex; /* 使用 Flexbox 排版 */
    align-items: center; /* 垂直居中對齊內容 */
    position: relative;
    padding: 0;
}

#header {
    background-color: var(--black-1);
}

#about {
    background-color: var(--black-2);
}

#projects {
    background-color: var(--black-3);
}

#contact {
    background-color: var(--black-4);
    overflow: hidden;
}

#footer {
    background-color: var(--black-5);
    flex-direction: column;
    justify-content: center;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2em;
    width: 100%;
}

/* Header */
#header {
    height: 100vh;
    display: flex;
    align-items: center;
    background-color: var(--main-bg-color);
    position: relative;
}

#header .inner {
    width: 100%;
    padding: 2em;
}

#header h1 {
    font-size: 4.5em;
    margin-bottom: 0.2em;
    color: var(--text-color);
}

#header p {
    color: var(--secondary-color);
    font-size: 1.2em;
    margin-bottom: 2em;
}

#header strong {
    color: var(--accent-color);
}

/* Header Layout */
.header-content {
    width: 100%;
    text-align: center;
}

/* Sections */
section {
    padding: 100px 0;
}

.style1 {
    background: linear-gradient(45deg, rgba(26, 21, 0, 0.8), rgba(45, 33, 0, 0.8));
    backdrop-filter: blur(10px);
}

.style2 {
    background: linear-gradient(-45deg, rgba(26, 21, 0, 0.9), rgba(45, 33, 0, 0.9));
    backdrop-filter: blur(10px);
}

/* Images */
.image.fit {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

.image.fit:hover {
    transform: translateY(-5px);
}

/* Buttons */
.button {
    display: inline-block;
    padding: 1em 2em;
    background: transparent;
    color: var(--accent-color);
    text-decoration: none;
    border: 1px solid var(--accent-color);
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 14px;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.3);
}

.button:hover {
    background: linear-gradient(45deg, rgba(255, 215, 0, 0.1), rgba(255, 179, 0, 0.1));
    border-color: var(--hover-color);
    color: var(--hover-color);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

/* 按鈕內容動畫 */
.button-content {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
}

.hover-float .button-content {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    transition: all 0.3s ease;
}

.hover-float:hover .button-content {
    animation: float 1.5s ease-in-out infinite;
    transform-origin: center;
}

/* Icons */
.major-icons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2em;
    list-style: none;
    padding: 2em;
}

.major-icons li span {
    color: var(--accent-color);
    font-size: 2em;
}

/* Footer */
#footer {
    background: linear-gradient(180deg, var(--dark-accent) 0%, var(--main-bg-color) 100%);
}

#footer .icons {
    list-style: none;
    margin-bottom: 2em;
}

#footer .icons li {
    display: inline-block;
    margin: 0 1em;
}

#footer .icons a {
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 1.5em;
    transition: all 0.3s ease;
    display: inline-block; /* 添加這行以支持變形 */
}

#footer .icons a:hover {
    color: var(--hover-color);
    transform: rotate(360deg);
    text-shadow: 0 0 10px var(--accent-color);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animation Classes */
/* 淡入上浮動畫初始狀態：元素透明並向下偏移，帶有過渡效果 */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-up:not(.visible) {
    opacity: 0;
    transform: translateY(30px);
    transition: none;
}

/* 新增動畫效果 */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

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

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

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

@keyframes glitch {
    0% {
        clip-path: polygon(0 2%, 100% 2%, 100% 5%, 0 5%);
        transform: translate(2px);
    }
    2% {
        clip-path: polygon(0 15%, 100% 15%, 100% 15%, 0 15%);
        transform: translate(-2px);
    }
    4% {
        clip-path: polygon(0 10%, 100% 10%, 100% 20%, 0 20%);
        transform: translate(1px);
    }
    6% {
        clip-path: polygon(0 1%, 100% 1%, 100% 2%, 0 2%);
        transform: translate(-1px);
    }
    8% {
        clip-path: polygon(0 33%, 100% 33%, 100% 33%, 0 33%);
        transform: translate(3px);
    }
    10% {
        clip-path: polygon(0 44%, 100% 44%, 100% 44%, 0 44%);
        transform: translate(-3px);
    }
    12% {
        clip-path: polygon(0 50%, 100% 50%, 100% 20%, 0 20%);
        transform: translate(3px);
    }
    14% {
        clip-path: polygon(0 70%, 100% 70%, 100% 70%, 0 70%);
        transform: translate(-2px);
    }
    16% {
        clip-path: polygon(0 80%, 100% 80%, 100% 80%, 0 80%);
        transform: translate(1px);
    }
    18% {
        clip-path: polygon(0 50%, 100% 50%, 100% 55%, 0 55%);
        transform: translate(-1px);
    }
    20% {
        clip-path: polygon(0 70%, 100% 70%, 100% 80%, 0 80%);
        transform: translate(2px);
    }
    100% {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
        transform: translate(0);
    }
}

/* 動畫類別 */
.float {
    animation: float 3s ease-in-out infinite;
}

.rotate {
    animation: rotate 10s linear infinite;
}

.scale {
    animation: scale 2s ease-in-out infinite;
    transform-origin: center;
    overflow: hidden;
    display: inline-block;
}

.slide-left {
    animation: slideInLeft 0.8s ease-out forwards;
}

.slide-right {
    animation: slideInRight 0.8s ease-out forwards;
}

.glitch {
    position: relative;
    animation: glitch 2s steps(100) infinite;
}

/* 滑鼠懸停效果 */
.hover-float:hover {
    animation: float 1.5s ease-in-out infinite;
}

.hover-rotate:hover {
    animation: rotate 2s linear infinite;
}

.hover-scale {
    display: inline-block;
    transition: all 0.3s ease;
}

.hover-scale:hover {
    animation: scale 1.5s ease-in-out infinite;
    color: var(--accent-color);
}

/* 確保按鈕內的圖標也會跟著放大縮小 */
.button.hover-scale i {
    transition: inherit;
}

/* 調整放大縮小的動畫時間 */
.project-links .button.hover-scale {
    animation: none;
    transition: all 0.3s ease;
}

.project-links .button.hover-scale:hover {
    animation: scale 1.5s ease-in-out infinite;
    background: rgba(100, 255, 218, 0.1);
}

/* Special Effects */
.gradient-text {
    background: linear-gradient(45deg, #ffd700, #ffb300, #ffe666, #ff9900);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-size: 300% 300%;
    animation: gradient 8s ease infinite;
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    25% { background-position: 50% 100%; }
    50% { background-position: 100% 50%; }
    75% { background-position: 50% 0%; }
    100% { background-position: 0% 50%; }
}

/* Responsive Design */
@media screen and (max-width: 980px) {
    #header h1 {
        font-size: 3em;
    }

    .row {
        flex-direction: column;
    }

    .col-6 {
        width: 100%;
        margin-bottom: 2em;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .header-right {
        margin-top: 2em;
    }
}

@media screen and (max-width: 736px) {
    #header h1 {
        font-size: 2.5em;
    }

    section {
        padding: 60px 0;
    }
}

/* 修改動畫效果，防止內容溢出 */
.scale {
    animation: scale 2s ease-in-out infinite;
    transform-origin: center;
    overflow: hidden;
    display: inline-block;
}

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

/* 修改聯絡區域的樣式 */
#contact {
    min-height: 100vh;
    height: 100vh;
    background-color: var(--black-4);
    display: flex;
    align-items: center;
    position: relative;
    padding: 0;
    overflow: hidden;
    text-align: center; /* 文字置中 */
}

#contact .container {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    padding: 4rem 2rem;
}

/* 調整聯絡區塊內容布局 */
#contact .major {
    margin-bottom: 2rem;
}

#contact .expand-diagonal {
    margin: 2rem 0;
}

.footer-content {
    margin-top: auto;
    padding: 2rem 0;
    text-align: center;
}

.footer-content .icons {
    list-style: none;
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    gap: 2em;
}

.footer-content .icons a {
    color: var(--secondary-color);
    font-size: 1.5em;
    transition: all 0.3s ease;
    display: inline-block;
}

.footer-content .icons a:hover {
    color: var(--hover-color);
    transform: rotate(360deg);
    text-shadow: 0 0 10px var(--accent-color);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.copyright {
    font-size: 0.9em;
    opacity: 0.8;
    margin: 0;
}

/* 確保響應式布局時也能填滿畫面 */
@media screen and (max-width: 736px) {
    #contact .container {
        padding: 3rem 1.5rem;
    }

    #contact .major {
        margin-bottom: 1.5rem;
    }

    .footer-content {
        padding: 1.5rem 0;
    }
}

/* 添加右下方伸展動畫 */
@keyframes expand-diagonal {
    0% {
        transform: scale(0);
        transform-origin: top left;
        opacity: 0;
    }
    100% {
        transform: scale(1);
        transform-origin: top left;
        opacity: 1;
    }
}

.expand-diagonal {
    animation: none;
    opacity: 0;
    transform: scale(0);
}

.expand-diagonal.visible {
    animation: expand-diagonal 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* 修改聯絡區域樣式 */
#contact p.expand-diagonal {
    display: inline-block;
    padding: 1em;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 215, 0, 0.1);
    border-radius: 8px;
    margin-bottom: 2em;
}

/* 導航點樣式 */
.nav-dots {
    position: fixed;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
}

.nav-dots ul {
    list-style: none;
}

.nav-dots li {
    margin: 1rem 0;
}

.nav-dots a {
    display: block;
    width: 12px;
    height: 12px;
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    transition: all 0.3s ease;
    position: relative;
}

.nav-dots a:hover,
.nav-dots a.active {
    background-color: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-color);
}

/* 在手機版隱藏導航點 */
@media screen and (max-width: 736px) {
    .nav-dots {
        display: none;
    }
}


.skill-list{
    margin-left: 1rem;
    list-style-position: inside;
}

/* 移除 spring 回彈動畫 */
.spring {
    animation: none;
}

/* 作品區塊連結按鈕在窄螢幕時上下間距加大 */
@media screen and (max-width: 600px) {
  .project-links {
    display: flex;
    flex-direction: column;
    gap: 1px;
    align-items: stretch;
  }
  .project-links a {
    margin-bottom: 1px;
    margin-top: 0;
  }
}
