/**
 * Blog Article Styles
 * 共用的部落格文章樣式
 * 所有 blog 文章都應該引用此檔案
 */

/* ===== 隱藏舊版導航 ===== */
.main-nav, .navbar { display: none !important; }
.breadcrumb { display: none !important; }

/* ===== Blog Topbar 導航列 ===== */
.blog-topbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 12px 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex !important;
}

.blog-topbar-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
}

.blog-logo {
    color: white;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: bold;
    white-space: nowrap;
}

.blog-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
    flex: 1;
    min-width: 0;
}

.blog-breadcrumb a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    white-space: nowrap;
}

.blog-breadcrumb a:hover {
    color: white;
    text-decoration: underline;
}

.blog-breadcrumb-separator {
    color: rgba(255,255,255,0.5);
}

.blog-breadcrumb-current {
    color: white;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 300px;
}

.blog-topbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.blog-language-switcher {
    display: flex;
    gap: 5px;
}

.blog-lang-btn {
    padding: 6px 12px;
    border: 1px solid rgba(255,255,255,0.3);
    background: transparent;
    color: rgba(255,255,255,0.8);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.blog-lang-btn:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.blog-lang-btn.active {
    background: white;
    color: #667eea;
    border-color: white;
}

/* ===== 文章主容器 ===== */
.blog-article {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
    background: #fff;
    min-height: 100vh;
}

.article-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 40px;
}

/* ===== 文章標題區 ===== */
.article-header {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #f0f0f0;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: #666;
}

.article-category {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: 500;
    font-size: 0.85rem;
}

.article-date, .reading-time {
    display: flex;
    align-items: center;
    gap: 5px;
}

.article-header h1 {
    font-size: 2.2rem;
    color: #333;
    line-height: 1.3;
    margin: 0 0 15px 0;
}

.article-subtitle {
    font-size: 1.2rem;
    color: #666;
    margin: 0;
    line-height: 1.6;
}

/* ===== 目錄樣式 ===== */
.table-of-contents {
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    border-radius: 12px;
    padding: 25px 30px;
    margin-bottom: 40px;
    border-left: 4px solid #667eea;
}

.table-of-contents h2 {
    font-size: 1.2rem;
    color: #333;
    margin: 0 0 15px 0;
    border-bottom: none;
}

.table-of-contents ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.table-of-contents li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
}

.table-of-contents li:last-child {
    border-bottom: none;
}

.table-of-contents a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.2s;
}

.table-of-contents a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* ===== 文章內容樣式 (article-body) ===== */
.article-body {
    line-height: 1.8;
    color: #333;
    font-size: 1rem;
}

.article-body h1 {
    font-size: 2rem;
    color: #333;
    margin: 50px 0 25px;
    padding-bottom: 10px;
    border-bottom: 3px solid #667eea;
    line-height: 1.3;
}

.article-body h2 {
    font-size: 1.6rem;
    color: #333;
    margin: 50px 0 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid #667eea;
    line-height: 1.4;
}

.article-body h3 {
    font-size: 1.3rem;
    color: #444;
    margin: 35px 0 20px;
    line-height: 1.4;
}

.article-body h4 {
    font-size: 1.1rem;
    color: #555;
    margin: 25px 0 15px;
}

.article-body p {
    margin: 0 0 20px;
    line-height: 1.8;
}

.article-body ul, .article-body ol {
    margin: 0 0 25px;
    padding-left: 25px;
}

.article-body li {
    margin-bottom: 10px;
    line-height: 1.7;
}

.article-body li > ul,
.article-body li > ol {
    margin-top: 10px;
    margin-bottom: 10px;
}

/* 行內程式碼 */
.article-body code {
    background: #f5f5f5;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    color: #e91e63;
}

/* 程式碼區塊 */
.article-body pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 25px 0;
    line-height: 1.5;
}

.article-body pre code {
    background: none;
    color: inherit;
    padding: 0;
    font-size: 0.9rem;
}

/* 引言區塊 */
.article-body blockquote {
    border-left: 4px solid #667eea;
    background: #f8f9ff;
    padding: 20px 25px;
    margin: 25px 0;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #555;
}

.article-body blockquote p {
    margin: 0;
}

/* 圖片樣式 */
.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 25px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* 表格樣式 */
.article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    font-size: 0.95rem;
}

.article-body th, .article-body td {
    border: 1px solid #e0e0e0;
    padding: 12px 15px;
    text-align: left;
}

.article-body th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
}

.article-body tr:nth-child(even) {
    background: #f9f9f9;
}

.article-body tr:hover {
    background: #f0f4ff;
}

/* 連結樣式 */
.article-body a {
    color: #667eea;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s;
}

.article-body a:hover {
    color: #764ba2;
    border-bottom-color: #764ba2;
}

/* 水平線 */
.article-body hr {
    border: none;
    height: 2px;
    background: linear-gradient(to right, #667eea, #764ba2);
    margin: 40px 0;
    border-radius: 2px;
}

/* 強調文字 */
.article-body strong {
    color: #333;
    font-weight: 600;
}

.article-body em {
    font-style: italic;
    color: #555;
}

/* ===== Blog 圖片容器 ===== */
.blog-image {
    margin: 30px 0;
    text-align: center;
}

.blog-image img,
.blog-img-responsive {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.blog-image figcaption {
    margin-top: 12px;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

/* ===== 資訊卡片 ===== */
.info-box, .warning-box, .tip-box, .note-box {
    padding: 20px 25px;
    border-radius: 8px;
    margin: 25px 0;
}

.info-box {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
}

.warning-box {
    background: #fff3e0;
    border-left: 4px solid #ff9800;
}

.tip-box {
    background: #e8f5e9;
    border-left: 4px solid #4caf50;
}

.note-box {
    background: #f3e5f5;
    border-left: 4px solid #9c27b0;
}

/* ===== 文章標籤 ===== */
.article-tags {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.article-tags .tag {
    display: inline-block;
    background: #f0f4ff;
    color: #667eea;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    margin: 5px 5px 5px 0;
    text-decoration: none;
    transition: all 0.2s;
}

.article-tags .tag:hover {
    background: #667eea;
    color: white;
}

/* ===== 側邊欄 ===== */
.blog-sidebar {
    margin-top: 40px;
}

.sidebar-widget {
    background: #f8f9ff;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.sidebar-widget h3 {
    margin: 0 0 15px;
    color: #333;
    font-size: 1.1rem;
}

.related-articles {
    list-style: none;
    padding: 0;
    margin: 0;
}

.related-articles li {
    padding: 10px 0;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.related-articles li:last-child {
    border-bottom: none;
}

.related-articles a {
    color: #667eea;
    text-decoration: none;
}

.related-articles a:hover {
    text-decoration: underline;
}

/* ===== Footer 樣式 ===== */
.article-footer {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid #f0f0f0;
}

.site-footer {
    background: #333;
    color: #fff;
    padding: 40px 20px;
    margin-top: 60px;
}

.site-footer .container {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
}

.footer-section h4 {
    margin: 0 0 15px;
    color: #fff;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section li {
    margin-bottom: 8px;
}

.footer-section a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.2);
    text-align: center;
    color: rgba(255,255,255,0.6);
}

/* ===== 響應式設計 ===== */
@media (max-width: 768px) {
    .blog-topbar {
        padding: 10px 15px;
    }

    .blog-topbar-container {
        flex-wrap: wrap;
    }

    .blog-breadcrumb {
        order: 3;
        width: 100%;
        margin-top: 10px;
        display: none;
    }

    .blog-breadcrumb-current {
        max-width: 200px;
    }

    .blog-article {
        padding: 20px 15px;
    }

    .article-container {
        padding: 25px 20px;
        border-radius: 8px;
    }

    .article-header h1 {
        font-size: 1.6rem;
    }

    .article-subtitle {
        font-size: 1rem;
    }

    .article-body h1 {
        font-size: 1.5rem;
    }

    .article-body h2 {
        font-size: 1.3rem;
        margin: 35px 0 20px;
    }

    .article-body h3 {
        font-size: 1.15rem;
        margin: 25px 0 15px;
    }

    .article-body pre {
        padding: 15px;
        font-size: 0.85rem;
    }

    .article-body table {
        font-size: 0.85rem;
    }

    .article-body th, .article-body td {
        padding: 8px 10px;
    }

    .table-of-contents {
        padding: 20px;
    }

    .footer-content {
        flex-direction: column;
        gap: 25px;
    }
}

@media (max-width: 480px) {
    .blog-article {
        padding: 15px 10px;
    }

    .article-container {
        padding: 20px 15px;
    }

    .article-header h1 {
        font-size: 1.4rem;
    }

    .article-body {
        font-size: 0.95rem;
    }

    .article-body h2 {
        font-size: 1.2rem;
    }

    .article-body h3 {
        font-size: 1.1rem;
    }
}
