/* styles.css */
:root {
    --primary-color: #24a124;
    --primary2-color: rgb(66, 208, 66);
    --secondary-color: #436cbd;
    --background-color: radial-gradient(circle at 20% 60%, #0f2027, #203a43, #2c5364);
    --text-color: #333;
    --hover-color: #7448f8;
}

body, html {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    font-family: sans-serif;
    background: radial-gradient(circle at 20% 50%, rgb(46, 49, 50), #000000, #4c4b4e)
}

/* 基本樣式 */
.navbar {
    position: fixed;
    top: 0;
    width: 97vw;
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    backdrop-filter: blur(10px);
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 9999;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: #00bfff;
    cursor: pointer;
    text-shadow: 0 0 10px #00bfff;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.1);
}


.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-links li a {
    color: white;
    text-decoration: none;
    font-size: 1rem;
    letter-spacing: 1px;
    position: relative;
    transition: color 0.3s;
}

.nav-links li a::after {
    content: "";
    position: absolute;
    width: 0%;
    height: 2px;
    background: #00bfff;
    left: 0;
    bottom: -4px;
    transition: width 0.3s ease;
}

.nav-links li a:hover::after {
    width: 100%;
}

.nav-links li a:hover {
    color: #00bfff;
}

/* 讓內文不要被 navbar 擋住 */
.hero, .content {
    padding-top: 70px;
}

/* 平滑滾動 */
html {
    scroll-behavior: smooth;
}

.hero {
    position: relative;
    height: 95vh;
    overflow: hidden;
}
.spot-light {
  color: white;
  text-shadow:
    0 0 8px #00bfff,
    0 0 16px #00bfff,
    0 0 32px #00bfff;
}

.bg-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.overlay {
    position: relative;
    z-index: 1;
    height: 95vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#animated-text {
    font-size: 5rem;
    font-weight: bold;
    position: relative;
    color: white;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    line-height: 1.2;
}

.letter-wrapper {
    position: relative;
    display: inline-block;
    margin: 0 4px;
    opacity: 0;
    transform: scale(0.8) rotateX(90deg);
    animation: cyberZoomIn 0.6s forwards;
}
.glow-loop {
  animation: cyberZoomIn 0.6s forwards, lightshine 10s infinite;
}

@keyframes cyberZoomIn {
    0% {
        opacity: 0;
        transform: scale(0.8) rotateX(90deg);
    }
    60% {
        opacity: 1;
        transform: scale(1.1) rotateX(10deg);
    }
    100% {
        opacity: 1;
        transform: none;
    }
}

@keyframes lightshine{
   0%
   {
    text-shadow:
    0 0 0px #00bfff,
    0 0 0px #00bfff,
    0 0 0px #00bfff;
   }
   70%
   {
      text-shadow:
    0 0 8px #00bfff,
    0 0 16px #00bfff,
    0 0 32px #00bfff;
   }
   100%{
    text-shadow:
    0 0 0px #00bfff,
    0 0 0px #00bfff,
    0 0 0px #00bfff;
   }
}

.letter-outline {
    position: absolute;
    top: 3px;
    left: 3px;
    -webkit-text-stroke: 2px #fff200;
    color: transparent;
}

.letter-fill {
    position: relative;
    color: #00bfff;
    text-shadow: 0 0 10px #00bfff;
}

.intro-container {
    text-align: center;
    background: rgba(255, 255, 255, 0.8);
    padding: 2em;
    border-radius: 10px;
}

.glitch {
    font-size: 3em;
    font-weight: bold;
    text-transform: uppercase;
    position: relative;
    color: var(--primary-color);
    letter-spacing: 0.1em;
    animation: glitch 1s linear infinite;
}

@keyframes glitch {
    2%, 64% {
        transform: translate(2px, 0) skew(0deg);
    }
    4%, 60% {
        transform: translate(-2px, 0) skew(0deg);
        color: #11b7b5;
    }
    62% {
        transform: translate(0, 0) skew(5deg);
    }
}

.glitch:before,
.glitch:after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch:before {
    left: 2px;
    text-shadow: -2px 0 #ff00c1;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch:after {
    left: -2px;
    text-shadow: -2px 0 #00fff9, 2px 2px #ff00c1;
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% {
        clip: rect(42px, 9999px, 44px, 0);
    }
    100% {
        clip: rect(32px, 9999px, 5px, 0);
    }
}

@keyframes glitch-anim2 {
    0% {
        clip: rect(12px, 9999px, 59px, 0);
    }
    100% {
        clip: rect(78px, 9999px, 11px, 0);
    }
}

.subtitle {
    font-size: 1.2em;
    margin-top: 1em;
    text-shadow: -3px 0 #03b0bd;
    font-weight: 1000;
    color: rgb(8, 82, 255);
}

.section-title {
    text-align: center;
    font-size: 2.5em;
    margin-bottom: 1em;
    color: var(--primary-color);
    text-shadow: 
        -1px -1px 0 #000,  
        1px -1px 0 #000,  
        -1px 1px 0 #000,  
        1px 1px 0 #000;
}

#content {
    font-family: 'Roboto', Arial, sans-serif;
    margin: 10px;
    padding: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
    
    background-size: cover;
    background-blend-mode: screen;
    
}

#about, #blogs, #contact {
    padding: 50px;
    margin: 50px;
    color:#dddbdb;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.365);
    background-color: #89888842;
}

.about-content {
    display: flex;
    align-items: center;      /* 垂直居中 */
    justify-content: center;   /* 水平居中 */
    gap: 50px;                /* 程式碼與照片之間的間距 */
    margin: 2vw auto;
    max-width: 1200px;        /* 限制最大寬度，避免在大螢幕分太開 */
}

/* 代碼容器外框 */
.about-text-container {
    flex: 1.5;                /* 比例較大一點，適合放代碼 */
    background-color: #1e1e1e;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    border: 1px solid #333;
    min-width: 450px;         /* 確保程式碼不會被擠壓太嚴重 */
}
/* 模擬視窗按鈕 */
.code-header {
    background-color: #323233;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}
.red { background-color: #ff5f56; }
.yellow { background-color: #ffbd2e; }
.green { background-color: #27c93f; }

.file-name {
    color: #969696;
    font-size: 13px;
    margin-left: 10px;
}

/* 程式碼本體 */
.about-text {
    padding: 20px;
    color: #d4d4d4; /* 預設文字顏色 */
    line-height: 1.6;
    font-size: 16px;
    white-space: pre; /* 保留換行與空格，關鍵！ */
    overflow-x: auto;  /* 手機版可以橫向捲動代碼 */
}

/* 語法高亮顏色 */
.about-text .keyword { color: #569cd6; }   /* 藍色：關鍵字 */
.about-text .type { color: #4ec9b0; }      /* 青色：類別名稱 */
.about-text .string { color: #ce9178; }    /* 橘紅色：字串 */
.about-text .comment { color: #6a9955; }   /* 綠色：註解 */
.about-text .number { color: #b5cea8; }    /* 淡綠色：數字 */
.about-text .method { color: #dcdcaa; }    /* 黃色：方法名稱 */

/* 讓程式碼區塊在 hover 時有一點發光感 */
.about-text-container:hover {
    box-shadow: 0 0 25px rgba(86, 156, 214, 0.2);
    transition: 0.3s;
}

/* 1. 確保外層容器是相對定位 */


/* 1. 修改你原本的 #about 樣式，增加 position: relative */
#about {
    padding: 50px;
    margin: 50px;
    color: #dddbdb;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.365);
    background-color: #89888842;
    position: relative; /* 關鍵：讓內層物件以這個區塊定位 */
    overflow: hidden;    /* 防止內容超出圓角邊框 */
}

/* 2. 定位右下角的 GitHub 標籤 */
.github-section-link {
    position: absolute;
    bottom: 0;           /* 貼齊底部 */
    right: 0;            /* 貼齊右側 */
    background: #333;    /* 深色背景 */
    color: white;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 10px;           /* 圖標與文字的間距 */
    text-decoration: none;
    border-top-left-radius: 15px; /* 左上角圓角，做出標籤感 */
    transition: all 0.3s ease;
    opacity: 0.8;
}

/* 3. 滑鼠懸停效果 */
.github-section-link:hover {
    opacity: 1;
    background: #4078c0; /* 懸停變藍色 */
    padding-right: 30px; /* 懸停時往右拉長一點的動感 */
}

.github-svg {
    transition: transform 0.3s ease;
}

.github-section-link:hover .github-svg {
    transform: rotate(360deg); /* 懸停時圖標轉一圈 */
}


.about-image {
    flex: 1;                  /* 比例較小 */
    text-align: center;       /* 圖片水平居中 */
    position: relative;
    display: flex;            /* 使用 flex 讓內容物更好控制 */
    justify-content: center;
    align-items: center;
}

.floating-image {
    max-width: 100%;          /* 讓圖片寬度自適應容器 */
    height: auto;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
    animation: float 6s ease-in-out infinite;
}


@keyframes float {
    0% { transform: translatey(0px); }
    50% { transform: translatey(-20px); }
    100% { transform: translatey(0px); }
}

.filter-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2em;
}

.filter-btn {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.5em 1em;
    margin: 0 0.5em;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s;
}

.filter-btn:hover, .filter-btn.active {
    background-color: var(--hover-color);
}

.blog-grid { 
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(232px, 550px);
  gap: 2em;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;

  padding-top: 30px;   /* 上空隙 */
  padding-bottom: 20px; /* 下空隙 */
}


.blog-grid > * {
   /* 彈性高度，自動撐開 */
  box-sizing: border-box;
}



.blog-post {
    border: 1px solid rgba(255, 255, 255, 0.224);
    background: rgba(0, 0, 0, 0.167);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.15);
    transition: transform 0.2s, box-shadow 0.2s;
}

.blog-image {
    height: 200px;
    background-size: cover;
    background-position: center;
}

.blog-content {
    padding: 1em;
}

.blog-link {
    text-decoration: none;
    color: inherit;
}
.blog-placeholder {
    visibility: hidden; /* 不顯示但保留空間 */
}

#pagination {
    text-align: center;
    margin-top: 2em;
}
.no-posts {
    display: flex;
    justify-content: center; 
    align-items: center;    
    height: 200px;
    text-align: center;
}
#pagination button {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.5em 1em;
    margin: 0 0.5em;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s;
}

#pagination button:hover:not(:disabled) {
    background-color: var(--hover-color);
}

#pagination button:disabled {
    background-color: #14145f18;
    cursor: not-allowed;
}

.contact-content {
    text-align: center;
}

footer {
    text-align: center;
    padding: 1em 0;
    background: rgb(28, 28, 28);
    color: white;
    
}

#theme-toggle-container {
    display: flex;
    align-items: center;
    margin-top: 1em;
}

.search-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1em;
}

#search-input {
    padding: 0.5em;
    font-size: 1em;
    border: 1px solid var(--secondary-color);
    border-radius: 5px 0 0 5px;
    width: 300px;
}

#search-button {
    padding: 0.5em 1em;
    font-size: 1em;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 0 5px 5px 0;
    cursor: pointer;
    transition: background-color 0.3s;
}

#clear-button {
    padding: 0.5em 1em;
    font-size: 1em;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#search-button:hover, #clear-button:hover {
    background-color: var(--hover-color);
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        padding: 1em;
    }

    nav ul {
        flex-direction: column;
        align-items: center;
    }

    nav ul li {
        margin: 0.5em 0;
    }

    .about-content {
        flex-direction: column;
    }

    .about-text, .about-image {
        width: 100%;
        padding: 0;
        margin-bottom: 1em;
    }

    .blog-grid {
        grid-template-columns: 1fr;
    }
}











