/* ==========================================
   重置和基礎樣式 (簡約科技風版)
   ========================================== */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Noto Sans TC', sans-serif; /* 使用更現代的無襯線字體 */
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    background-image: var(--grid-pattern);
    background-size: 40px 40px; /* 網格大小 */
    min-height: 100vh;
    transition: color 0.3s ease, background-color 0.3s ease;
}

/* 裝飾性代碼字體 */
.font-mono {
    font-family: var(--font-mono);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ==========================================
   導航欄 - 極簡化
   ========================================== */

.navbar {
    background: rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-dim);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
}

.nav-title {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.nav-title::before {
    content: '> ';
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--primary-color);
    box-shadow: var(--glow-primary);
}

/* 主題切換按鈕 - 簡化 */
.theme-toggle {
    background: transparent;
    border: 1px solid var(--border-dim);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: var(--glow-primary);
}

/* ==========================================
   英雄區塊 - 科技佈局
   ========================================== */

.main-content {
    margin-top: 70px;
}

.hero {
    min-height: 85vh;
    display: flex;
    align-items: center;
    position: relative;
    border-bottom: 1px solid var(--border-dim);
}

.hero::after {
    /* 底部掃描線效果 */
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--primary-color);
    box-shadow: var(--glow-primary);
    opacity: 0.5;
}

.hero-container {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr; /* 文字區稍大 */
    gap: 4rem;
    align-items: center;
}

.hero-badge {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    display: inline-block;
    padding: 4px 8px;
    border: 1px solid var(--primary-color);
    background: rgba(0, 240, 255, 0.05);
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -1px;
}

.text-highlight {
    color: transparent;
    -webkit-text-stroke: 1px var(--primary-color);
    position: relative;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: 3rem;
    font-weight: 300;
}

/* 科技風按鈕 */
.hero-buttons {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 4rem;
}

.btn {
    padding: 12px 32px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 2px; /* 近乎直角 */
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-primary {
    background: var(--primary-color);
    color: #000;
    border: 1px solid var(--primary-color);
}

.btn-primary:hover {
    background: transparent;
    color: var(--primary-color);
    box-shadow: var(--glow-primary);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-dim);
}

.btn-secondary:hover {
    border-color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

/* 數據儀表板 */
.hero-stats {
    display: flex;
    gap: 3rem;
    border-top: 1px solid var(--border-dim);
    padding-top: 2rem;
}

.stat-number {
    font-family: var(--font-mono);
    font-size: 2.5rem;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* 右側終端機視覺 */
.hero-visual {
    position: relative;
}

.terminal-window {
    background: rgba(10, 10, 10, 0.9);
    border: 1px solid var(--border-dim);
    border-radius: 4px;
    padding: 2px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

.terminal-header {
    background: #1a1a1a;
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-dim);
}

.terminal-title {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.terminal-controls {
    display: flex;
    gap: 8px;
}

.control {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid #444;
}

.terminal-body {
    padding: 20px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: #a9a9a9;
    min-height: 300px;
}

.cmd { color: var(--primary-color); }
.arg { color: var(--success-color); }
.path { color: #7000FF; }

.cursor {
    display: inline-block;
    width: 8px;
    height: 15px;
    background: var(--primary-color);
    animation: blink 1s step-end infinite;
    vertical-align: middle;
}

@keyframes blink { 50% { opacity: 0; } }

/* ==========================================
   卡片樣式 (通用)
   ========================================== */
   
.section-header {
    margin-bottom: 4rem;
    position: relative;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.section-title::before {
    content: '# ';
    color: var(--primary-color);
}

/* 簡約卡片 */
.card-base {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-dim);
    border-radius: 4px;
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
}

.card-base:hover {
    border-color: var(--primary-color);
    box-shadow: var(--glow-primary);
    transform: translateY(-2px);
}

/* 特色卡片 */
.feature-card {
    background: rgba(20, 20, 20, 0.5);
    border: 1px solid var(--border-dim);
    padding: 2rem;
    transition: 0.3s;
}

.feature-card:hover {
    border-color: var(--primary-color);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    filter: drop-shadow(0 0 5px var(--primary-color));
}

/* 插件網格布局 */
.plugins-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* 插件卡片 */
.plugin-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-dim);
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

.plugin-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.plugin-card-header {
    background: #111;
    height: 180px; /* 稍微增加高度 */
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-dim);
    padding: 20px; /* 增加內距防止圖片貼邊 */
    position: relative;
    overflow: hidden;
}

/* 圖片容器樣式優化 */
.plugin-card-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    transition: 0.3s;
}

.plugin-card-icon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* 確保圖片完整顯示不裁切 */
    filter: grayscale(20%); /* 稍微降低飽和度配合科技風 */
    transition: all 0.3s ease;
}

.plugin-card:hover .plugin-card-icon img {
    filter: grayscale(0%);
    transform: scale(1.05);
}

.plugin-card-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.plugin-card-title {
    font-family: var(--font-mono);
    font-size: 1.1rem; /* 稍微縮小標題 */
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.plugin-card-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* 限制顯示行數 */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.plugin-category {
    font-size: 0.7rem;
    font-family: var(--font-mono);
    color: var(--primary-color);
    border: 1px solid var(--border-dim);
    padding: 4px 8px;
    display: inline-block;
    margin-bottom: 0; /* 調整間距 */
    background: rgba(0, 240, 255, 0.05);
}

.plugin-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto; /* 推到底部 */
    padding-top: 1rem;
    border-top: 1px solid var(--border-dim);
}

.plugin-card-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border-dim);
    background: rgba(255,255,255,0.02);
}

.btn-small {
    width: 100%;
    justify-content: center;
    font-size: 0.85rem;
    padding: 10px;
}

/* 修正首頁 Featured Grid 的卡片內部間距 */
.featured-grid .plugin-card-description {
    margin-bottom: 1rem;
}

/* 插件列表區塊 */
.plugins-section {
    padding: 3rem 0;
    min-height: 400px;
}

.loading {
    text-align: center;
    padding: 4rem 0;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.no-results {
    text-align: center;
    padding: 4rem 0;
    color: var(--text-secondary);
}

.no-results h3 {
    color: var(--primary-color);
    font-family: var(--font-mono);
    margin-bottom: 1rem;
}

/* ========================================== 插件頁面 - 系統規格與篩選器 (Tech Redesign)
   ========================================== */

/* 頁面標題 */
.terminal-header-style {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    opacity: 0.7;
}

.page-header {
    padding: 4rem 0 2rem;
    border-bottom: 1px solid var(--border-dim);
    margin-bottom: 2rem;
}

.page-title {
    font-family: var(--font-mono);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

.page-subtitle {
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

/* 系統規格區塊 */
.system-specs {
    padding: 2rem 0 4rem;
}

.specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.spec-panel {
    background: rgba(10, 10, 10, 0.5);
    border: 1px solid var(--border-dim);
    border-left: 2px solid var(--primary-color);
    padding: 1.5rem;
    font-family: var(--font-mono);
}

.spec-header {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-dim);
    padding-bottom: 0.5rem;
}

.spec-title {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.spec-row {
    display: flex;
    margin-bottom: 0.8rem;
    font-size: 0.85rem;
    align-items: baseline;
}

.spec-key {
    color: var(--success-color);
    min-width: 80px;
    margin-right: 1rem;
    font-weight: 600;
}

.spec-val {
    color: var(--text-secondary);
    line-height: 1.4;
}

/* 平台列表 */
.platform-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.platform-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 1rem;
    border-radius: 2px;
    font-size: 0.8rem;
    color: var(--text-primary);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success-color);
    box-shadow: 0 0 5px var(--success-color);
}

.platform-warning {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--danger-color);
    font-size: 0.8rem;
    border: 1px solid var(--danger-color);
    padding: 0.5rem;
    display: inline-flex;
}

/* 篩選器 - 命令行風格 */
.filters {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-dim);
    border-bottom: 1px solid var(--border-dim);
    padding: 1.5rem 0;
    position: relative; /* Changed from sticky to relative */
    z-index: 900;
    backdrop-filter: blur(10px);
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: center;
    font-family: var(--font-mono);
}

.search-box {
    display: flex;
    align-items: center;
    background: #000;
    border: 1px solid var(--border-dim);
    padding: 0.5rem 1rem;
    min-width: 300px;
    flex: 1;
}

.search-prompt {
    color: var(--primary-color);
    margin-right: 0.5rem;
    font-size: 0.9rem;
}

.search-input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    width: 100%;
    outline: none;
}

.search-suffix {
    color: var(--primary-color);
}

.filter-options {
    display: flex;
    gap: 1.5rem;
}

.select-wrapper {
    display: flex;
    align-items: center;
    font-size: 0.85rem;
}

.select-label {
    color: var(--text-secondary);
    margin-right: 0.5rem;
}

.filter-select {
    background: transparent;
    border: none;
    color: var(--success-color);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
    padding-right: 1rem;
}

.filter-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* 載入狀態 */
.blink {
    animation: blink 1s step-end infinite;
    color: var(--primary-color);
    font-family: var(--font-mono);
}

/* ==========================================
   頁腳
   ========================================== */

.footer {
    border-top: 1px solid var(--border-dim);
    padding: 4rem 0 2rem;
    background: var(--bg-primary);
    margin-top: auto;
}

.footer-title {
    font-family: var(--font-mono);
    font-size: 1rem;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: 0.2s;
}

.footer-links a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

/* ==========================================
   響應式設計 & 移動端適配 (Mobile)
   ========================================== */

/* 漢堡選單按鈕 (Mobile Only) */
.hamburger {
    display: none; /* Desktop 隱藏 */
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    z-index: 1002;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text-primary);
    transition: all 0.3s ease;
}

/* 漢堡選單動畫 */
.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.active span:nth-child(2) {
    opacity: 0;
}
.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Media Query: Mobile & Tablet (< 968px) */
@media (max-width: 968px) {
    /* 導航欄響應式 */
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%; /* 默認隱藏在右側 */
        width: 70%;
        height: 100vh;
        background: rgba(5, 5, 5, 0.95);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        gap: 2rem;
        padding: 2rem;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        border-left: 1px solid var(--border-dim);
        z-index: 1001;
    }

    .nav-menu.active {
        right: 0; /* 滑入顯示 */
    }

    .nav-link {
        font-size: 1.2rem;
        width: 100%;
        text-align: center;
    }
    
    /* 英雄區塊響應式 */
    .hero-container {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
        padding-top: 2rem;
    }
    
    .hero-text {
        order: 2;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .hero-badge {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .hero-stats {
        justify-content: center;
        flex-wrap: wrap;
        gap: 2rem;
    }
    
    .hero-visual {
        /* 手機版顯示精簡的終端機或直接隱藏 */
        display: none; 
        order: 1;
    }

    /* 系統規格 (plugins.html) 響應式 */
    .specs-grid {
        grid-template-columns: 1fr;
    }
    
    /* 篩選器 (plugins.html) 響應式 */
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 1.5rem;
    }
    
    .search-box {
        width: 100%;
    }
    
    .filter-options {
        flex-wrap: wrap;
        justify-content: space-between;
    }
    
    .select-wrapper {
        width: 48%; /* 兩個一排 */
    }

    /* 插件詳情頁響應式 */
    .content-grid {
        grid-template-columns: 1fr !important; /* 強制單欄 */
    }
    
    .plugin-header {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    
    .plugin-icon {
        margin: 0 auto;
    }
    
    .plugin-actions {
        justify-content: center;
    }
    
    /* 關於我頁面響應式 */
    .about-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .about-avatar {
        margin: 0 auto;
    }
    
    .about-cta {
        justify-content: center;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
    }
}

/* Media Query: Small Mobile (< 480px) */
@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .select-wrapper {
        width: 100%; /* 一個一排 */
    }
    
    .plugin-card-header {
        height: 160px;
    }
    
    .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}
