/* 全局設定與 CSS 變數 */
:root {
    --bg-color: #0f172a;
    /* 暗色背景 */
    --glass-bg: rgba(255, 255, 255, 0.05);
    /* 玻璃毛玻璃底色 */
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #38bdf8;
    --accent-hover: #0ea5e9;
    --card-bg: rgba(30, 41, 59, 0.7);
    --transition-fast: 0.3s ease;
}

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

body {
    font-family: 'Outfit', 'Noto Sans TC', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* 網頁自訂捲軸 */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--card-bg);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* 背景光效 Blob 動畫 */
.blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.5;
    animation: float 10s infinite ease-in-out alternate;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: linear-gradient(to right, #4338ca, #38bdf8);
    top: -100px;
    left: -100px;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: linear-gradient(to right, #ec4899, #8b5cf6);
    bottom: -150px;
    right: -100px;
    animation-direction: alternate-reverse;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(50px, 50px) scale(1.1);
    }
}

/* 主容器：毛玻璃效果 (Glassmorphism) */
.glass-container {
    max-width: 1200px;
    margin: 40px auto;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Hero Section / 檔頭資訊 */
.hero {
    text-align: center;
    margin-bottom: 60px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--glass-border);
}

.brand {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: 1px;
}

.highlight {
    background: linear-gradient(90deg, #38bdf8, #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 300;
}

/* 每的章節 / Section 設定 */
.portfolio-section {
    margin-bottom: 60px;
}

.section-header {
    margin-bottom: 30px;
}

.section-header h2 {
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.section-header i {
    color: var(--accent-color);
}

.section-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 5px;
}

/* 網格系統 Grid (卡片排版) */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
}

/* Project Cards 卡片設計 */
.project-card {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition-fast);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
    border-color: rgba(56, 189, 248, 0.3);
}

/* 卡片圖片與遮罩區塊 */
.card-image {
    height: 180px;
    position: relative;
    background-size: cover;
    background-position: center;
    overflow: hidden;
}

/* 給沒有圖片時的漸層底色替代 */
.preview-bg-1 {
    background: linear-gradient(135deg, #1e3a8a, #3b82f6);
}

.preview-bg-2 {
    background: linear-gradient(135deg, #064e3b, #10b981);
}

.preview-bg-3 {
    background: linear-gradient(135deg, #4c1d95, #8b5cf6);
}

.preview-bg-4 {
    background: linear-gradient(135deg, #9d174d, #f43f5e);
}

.preview-bg-5 {
    background: linear-gradient(135deg, #7c2d12, #f97316);
}

.preview-bg-6 {
    background: linear-gradient(135deg, #0f766e, #14b8a6);
}

.preview-bg-7 {
    background: linear-gradient(135deg, #374151, #9ca3af);
}

.preview-bg-8 {
    background: linear-gradient(135deg, #ea580c, #fcd34d);
}

.preview-bg-9 {
    background: linear-gradient(135deg, #b45309, #fde68a);
}

/* 滑鼠移入時顯示「查看專案」的 Overlay 透明遮罩 */
.overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition-fast);
}

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

.view-btn {
    padding: 10px 20px;
    background-color: var(--accent-color);
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.project-card:hover .view-btn {
    transform: translateY(0);
}

/* 卡片內文 */
.card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-content h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    font-weight: 600;
}

.card-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 20px;
    flex-grow: 1;
}

/* 標籤分類 Tag */
.tag {
    align-self: flex-start;
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent-color);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(56, 189, 248, 0.2);
}

.tag.cms {
    background: rgba(139, 92, 246, 0.1);
    color: #a78bfa;
    border-color: rgba(139, 92, 246, 0.2);
}

/* 預留空位卡片 (Coming Soon) */
.empty-card {
    border: 1px dashed var(--text-secondary);
    background: transparent;
    cursor: default;
}

.empty-card:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--text-secondary);
}

.center-content {
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 2rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* 頁尾 Footer */
footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--glass-border);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* 響應式佈局 (Mobile) */
@media (max-width: 768px) {
    .glass-container {
        margin: 20px;
        padding: 20px;
        border-radius: 12px;
    }

    .brand {
        font-size: 2.2rem;
    }
}