/* =========================================
   1. 全域設定 (Global Settings)
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* 逐浪百川：深海藍到青色的動態漸層背景 */
body {
    background: linear-gradient(135deg, #0A192F 0%, #112240 50%, #004d7a 100%);
    background-attachment: fixed;
    color: #CCD6F6;
    line-height: 1.6;
    min-height: 100vh;
}

/* =========================================
   2. 導覽列 (Navigation)
   ========================================= */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 50px;
    background: rgba(10, 25, 47, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #64FFDA;
    text-decoration: none;
    cursor: pointer;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 30px;
}

.nav-links a {
    color: #CCD6F6;
    text-decoration: none;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #64FFDA;
}

/* =========================================
   3. 首頁視覺區 (Hero Section)
   ========================================= */
.hero {
    height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 20px;
}

.hero h1 {
    font-size: 3rem;
    color: #E6F1FF;
    margin-bottom: 20px;
}

.hero .highlight {
    color: #64FFDA;
}

.fade-out {
    transition: opacity 0.2s linear;
}

/* =========================================
   4. 卡片容器 (Portfolio Grid)
   ========================================= */
.container {
    max-width: 1200px;
    margin: 0 auto 100px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.card {
    background: rgba(17, 34, 64, 0.7);
    border: 1px solid rgba(100, 255, 218, 0.1);
    border-radius: 16px;
    padding: 30px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-12px);
    box-shadow: 0 15px 30px rgba(0, 180, 216, 0.2);
    border-color: rgba(100, 255, 218, 0.5);
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.card h3 {
    color: #E6F1FF;
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.card p {
    color: #8892B0;
    margin-bottom: 20px;
}

.tags {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tags li {
    font-size: 0.85rem;
    color: #64FFDA;
    background: rgba(100, 255, 218, 0.1);
    padding: 5px 10px;
    border-radius: 20px;
}

/* =========================================
   5. 文章頁面專用樣式 (Post & Blog List)
   ========================================= */

/* 置中的玻璃質感容器 */
.post-container {
    max-width: 850px;
    margin: 40px auto;
    padding: 40px;
    background: rgba(17, 34, 64, 0.5); /* 半透明以透出背景漸層 */
    border-radius: 16px;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(100, 255, 218, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* 標題與資訊置中 */
.post-header-center {
    text-align: center;
    margin-bottom: 30px;
}

.post-title {
    font-size: 2.5rem;
    color: #E6F1FF;
    margin-bottom: 10px;
}

.post-meta {
    color: #64FFDA;
    font-size: 0.9rem;
}

/* Markdown 內容區塊 */
#content {
    line-height: 1.8;
    color: #CCD6F6;
    max-width: 800px;
    margin: auto;
}

/* 強制 Markdown 背景透明，繼承 body 的漸層 */
.markdown-body {
    background: transparent !important;
}

/* 程式碼區塊樣式修正 */
#content pre {
    background: rgba(2, 12, 27, 0.7) !important;
    padding: 20px;
    border-radius: 10px;
    overflow-x: auto;
    border: 1px solid rgba(100, 255, 218, 0.2);
    margin: 20px 0;
}

/* 文章列表項目的樣式 (blog.html) */
.post-item {
    background: rgba(255, 255, 255, 0.05);
    border-left: 5px solid #64FFDA;
    padding: 15px 20px;
    margin: 15px 0;
    transition: 0.3s;
    cursor: pointer;
}

.post-item:hover {
    background: rgba(100, 255, 218, 0.1);
    transform: translateX(5px);
}

/* =========================================
   6. 頁腳與動畫 (Footer & Animations)
   ========================================= */
footer {
    text-align: center;
    padding: 30px;
    color: #8892B0;
    font-size: 0.9rem;
}

.fade {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease;
}

.fade.show {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================
   7. 聯絡方式圖示 (Contact Icons)
   ========================================= */
.contact-icons {
    margin-top: 25px;
    display: flex;
    gap: 20px;
    justify-content: center; /* 讓圖示在首頁置中 */
}

.contact-icons a {
    color: #CCD6F6; /* 圖示預設顏色 */
    transition: all 0.3s ease;
    text-decoration: none;
}

.contact-icons a:hover {
    color: #64FFDA; /* 懸停時變青色 */
    transform: translateY(-5px); /* 懸停時稍微上浮 */
}

/* 圖示的大小設定 */
.contact-icons .icon {
    width: 28px;
    height: 28px;
}

