:root {
    --text-dark: #1e293b;
    --gray-500: #64748b;
    --emerald-500: #10b981;
}

/* 基礎字體與平滑滾動 */
html {
    scroll-behavior: smooth;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* 隱藏捲軸但保留滾動功能 (美化側邊欄) */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: #475569;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #64748b;
}

/* 側邊欄按鈕過渡 */
#menu-nav button {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 針對選單目前的啟用狀態 */
.active-menu {
    background-color: #1e293b !important;
    color: #34d399 !important;
    border-left: 4px solid #34d399 !important;
    transform: translateX(4px);
}

/* 進場動畫 */
.animate-fade-in {
    animation: fadeIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 目錄卡片陰影增強 */
.hover\:shadow-xl:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* ======= 首頁改善新增樣式 ======= */

/* Hero 歡迎區塊 */
.hero-section {
    box-shadow: 0 10px 40px -10px rgba(16, 185, 129, 0.3);
}

/* 工具數量 Badge */
.tool-count-badge {
    transition: transform 0.3s ease;
}

.tool-count-badge:hover {
    transform: scale(1.05);
}

/* 熱門工具卡片 - 特殊漸層邊框 */
.hot-tool-card {
    position: relative;
    background: linear-gradient(135deg, #fff7ed, #fffbeb, #ffffff);
    border: 2px solid transparent;
    background-clip: padding-box;
}

.hot-tool-card::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: linear-gradient(135deg, #f97316, #eab308, #10b981);
    z-index: -1;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.hot-tool-card:hover::before {
    opacity: 1;
}

.hot-tool-card .hot-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: linear-gradient(135deg, #f97316, #ef4444);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 0 12px 0 8px;
    z-index: 2;
    letter-spacing: 0.5px;
}

/* 廣告卡片 */
.ad-card {
    border-radius: 12px;
}

.ad-label {
    border-top: 1px solid #f1f5f9;
    background: #fafbfc;
}

/* 分類標題圖示 */
.category-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    font-size: 14px;
    margin-right: 6px;
}

/* 一般工具卡片 hover 效果增強 */
.overview-tool-btn {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.overview-tool-btn:hover {
    transform: translateY(-2px);
}

/* 進場動畫 - 逐一淡入 */
@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-animate {
    animation: cardFadeIn 0.4s ease-out forwards;
}

/* 脈動效果 - 熱門標籤 */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.4);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(249, 115, 22, 0);
    }
}

.hot-tool-card:hover {
    animation: pulse-glow 1.5s ease-in-out infinite;
}

/* 響應式優化 */
@media (max-width: 640px) {
    .hero-section h2 {
        font-size: 1.25rem;
    }

    .tool-count-badge {
        padding: 8px 12px;
    }

    .tool-count-badge .text-3xl {
        font-size: 1.5rem;
    }
}
