/* 全局樣式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Noto Sans TC', Arial, sans-serif;
}

body {
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.main-header {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: #4a90e2;
    text-decoration: none;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
}

.main-nav ul li a {
    text-decoration: none;
    color: #333;
    font-size: 1rem;
    font-weight: 400;
    transition: color 0.3s;
}

.main-nav ul li a:hover,
.main-nav ul li a.active {
    color: #4a90e2;
}

/* 移動端菜單按鈕 */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.menu-toggle .bar {
    width: 25px;
    height: 3px;
    background-color: #333;
    margin: 4px 0;
    transition: all 0.3s ease;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #4a90e2, #50c9c3);
    color: #fff;
    text-align: center;
    padding: 80px 20px;
    margin-bottom: 40px;
}

.hero-section h1 {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.hero-section p {
    font-size: 1.2rem;
    margin-bottom: 25px;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.2s;
}

.primary-btn {
    background-color: #ff6f61;
    color: #fff;
}

.primary-btn:hover {
    background-color: #e55a50;
    transform: translateY(-2px);
}

.secondary-btn {
    background-color: #333;
    color: #fff;
}

.secondary-btn:hover {
    background-color: #555;
    transform: translateY(-2px);
}

/* Latest Section */
.latest-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.latest-section h2 {
    font-size: 2rem;
    margin-bottom: 30px;
    text-align: center;
    color: #222;
}

/* Tool Grid */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.tool-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.tool-logo {
    max-width: 80px;
    height: auto;
    margin-bottom: 15px;
}

.tool-card h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
}

.tool-card h3 a {
    color: #333;
    text-decoration: none;
}

.tool-card h3 a:hover {
    color: #4a90e2;
}

.tool-description {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 15px;
}

.tool-categories {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.tool-categories span {
    background-color: #e6f3ff;
    color: #4a90e2;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
}

.detail-btn {
    background-color: #4a90e2;
    color: #fff;
}

.detail-btn:hover {
    background-color: #357abd;
}

/* Article List */
.article-list-home {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.article-preview-card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.article-preview-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.article-preview-card h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.article-preview-card h3 a {
    color: #333;
    text-decoration: none;
}

.article-preview-card h3 a:hover {
    color: #4a90e2;
}

.article-meta {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 10px;
}

.article-preview-card p {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 15px;
}

.read-more {
    color: #4a90e2;
    text-decoration: none;
    font-weight: bold;
}

.read-more:hover {
    color: #357abd;
}

/* View All */
.view-all {
    text-align: center;
    margin-top: 30px;
}

/* Footer */
.main-footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 20px 0;
    margin-top: 40px;
}

.main-footer p {
    font-size: 0.9rem;
}

/* 分隔線 */
hr {
    border: none;
    border-top: 1px solid #ddd;
    margin: 40px 0;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2rem;
    }

    .hero-section p {
        font-size: 1rem;
    }

    .latest-section h2 {
        font-size: 1.8rem;
    }

    .tool-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .article-list-home {
        grid-template-columns: 1fr;
    }

    /* 移動端導航 */
    .main-nav ul {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        background-color: #fff;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        padding: 20px;
    }

    .main-nav ul.active {
        display: flex;
    }

    .main-nav ul li {
        margin: 10px 0;
    }

    .menu-toggle {
        display: flex;
    }
}