/* =====================================================
   FELO 菲絡蒸汽 - 文章美化樣式表
   手機響應式設計 | 精美排版 | SEO 友好
   ===================================================== */

/* 1. 基礎設定 */
.article-content {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Microsoft JhengHei", sans-serif;
    font-size: 16px;
    line-height: 1.8;
    color: #333;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* 2. 標題樣式 - 響應式 */
.article-content h1 {
    font-size: clamp(24px, 5vw, 32px);
    font-weight: 700;
    color: #1a1a1a;
    margin: 40px 0 25px 0;
    padding-bottom: 15px;
    border-bottom: 3px solid #0073aa;
    line-height: 1.3;
}

.article-content h2 {
    font-size: clamp(22px, 4.5vw, 28px);
    font-weight: 600;
    color: #2a2a2a;
    margin: 35px 0 20px 0;
    padding-left: 15px;
    border-left: 4px solid #0073aa;
    line-height: 1.3;
}

.article-content h3 {
    font-size: clamp(18px, 4vw, 22px);
    font-weight: 600;
    color: #3a3a3a;
    margin: 28px 0 15px 0;
    padding-left: 12px;
    border-left: 3px solid #00a0d2;
    line-height: 1.3;
}

.article-content h4 {
    font-size: clamp(16px, 3.5vw, 18px);
    font-weight: 600;
    color: #4a4a4a;
    margin: 22px 0 12px 0;
    line-height: 1.3;
}

/* 3. 段落樣式 */
.article-content p {
    margin: 18px 0;
    line-height: 1.9;
    text-align: justify;
    word-spacing: 0.05em;
}

.article-content p:first-of-type {
    font-size: 18px;
    font-weight: 500;
    color: #444;
}

/* 4. 列表樣式 */
.article-content ul,
.article-content ol {
    margin: 20px 0;
    padding-left: 25px;
}

.article-content li {
    margin: 12px 0;
    line-height: 1.8;
    position: relative;
}

.article-content ul li {
    list-style: none;
    padding-left: 25px;
}

.article-content ul li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #0073aa;
    font-weight: bold;
    font-size: 18px;
}

.article-content ol li {
    counter-increment: list-counter;
    padding-left: 30px;
}

.article-content ol {
    counter-reset: list-counter;
}

.article-content ol li:before {
    content: counter(list-counter);
    position: absolute;
    left: 0;
    background: #0073aa;
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    text-align: center;
    line-height: 22px;
    font-size: 13px;
    font-weight: 600;
}

/* 5. 表格樣式 - 響應式 */
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    font-size: 15px;
    overflow-x: auto;
    display: block;
}

.article-content table thead {
    background: linear-gradient(135deg, #0073aa 0%, #00a0d2 100%);
    color: white;
}

.article-content table th {
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    border: 1px solid #005a87;
}

.article-content table td {
    padding: 12px;
    border: 1px solid #ddd;
    background: #fff;
}

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

.article-content table tr:hover td {
    background: #f0f8ff;
    transition: background 0.3s ease;
}

@media (max-width: 768px) {
    .article-content table {
        font-size: 13px;
    }
    .article-content table th,
    .article-content table td {
        padding: 10px 8px;
    }
}

/* 6. 引用區塊樣式 */
.article-content blockquote {
    margin: 25px 0;
    padding: 20px 25px;
    background: linear-gradient(135deg, #f9f9f9 0%, #f0f0f0 100%);
    border-left: 5px solid #0073aa;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #555;
    position: relative;
}

.article-content blockquote:before {
    content: """;
    font-size: 60px;
    color: #0073aa;
    opacity: 0.2;
    position: absolute;
    top: -10px;
    left: 10px;
    font-family: Georgia, serif;
}

/* 7. 圖片樣式 - 響應式 */
.article-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 25px auto;
    border-radius: 12px;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article-content img:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.article-content figure {
    margin: 30px 0;
    text-align: center;
}

.article-content figcaption {
    margin-top: 12px;
    font-size: 14px;
    color: #777;
    font-style: italic;
}

/* 8. 代碼樣式 */
.article-content code {
    background: #f5f5f5;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: "Courier New", Courier, monospace;
    font-size: 14px;
    color: #e74c3c;
    border: 1px solid #e0e0e0;
}

.article-content pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 25px 0;
    font-family: "Courier New", Courier, monospace;
    font-size: 14px;
    line-height: 1.6;
}

/* 9. 連結樣式 */
.article-content a {
    color: #0073aa;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    font-weight: 500;
}

.article-content a:hover {
    color: #00a0d2;
    border-bottom-color: #00a0d2;
}

/* 10. 強調樣式 */
.article-content strong {
    font-weight: 700;
    color: #1a1a1a;
}

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

/* 11. 分隔線樣式 */
.article-content hr {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #0073aa 50%, transparent 100%);
    margin: 40px 0;
}

/* 12. 提示框樣式 */
.article-content .tip-box {
    background: linear-gradient(135deg, #e8f4f8 0%, #d0e8f0 100%);
    border-left: 5px solid #0073aa;
    padding: 20px;
    margin: 25px 0;
    border-radius: 0 8px 8px 0;
}

.article-content .tip-box-title {
    font-weight: 600;
    color: #0073aa;
    margin-bottom: 10px;
    font-size: 16px;
}

/* 13. 重點框樣式 */
.article-content .highlight-box {
    background: linear-gradient(135deg, #fff9e6 0%, #fff3cc 100%);
    border: 2px solid #f0ad4e;
    padding: 20px;
    margin: 25px 0;
    border-radius: 8px;
}

.article-content .highlight-box-title {
    font-weight: 600;
    color: #f0ad4e;
    margin-bottom: 10px;
    font-size: 16px;
}

/* 14. 警告框樣式 */
.article-content .warning-box {
    background: linear-gradient(135deg, #ffe6e6 0%, #ffcccc 100%);
    border-left: 5px solid #e74c3c;
    padding: 20px;
    margin: 25px 0;
    border-radius: 0 8px 8px 0;
}

.article-content .warning-box-title {
    font-weight: 600;
    color: #e74c3c;
    margin-bottom: 10px;
    font-size: 16px;
}

/* 15. 手機版優化 */
@media (max-width: 768px) {
    .article-content {
        padding: 15px;
        font-size: 15px;
    }
    .article-content h1 {
        margin-top: 30px;
    }
    .article-content h2 {
        margin-top: 25px;
    }
    .article-content p {
        font-size: 15px;
        line-height: 1.8;
    }
    .article-content ul,
    .article-content ol {
        padding-left: 20px;
    }
    .article-content li {
        margin: 10px 0;
    }
    .article-content blockquote {
        padding: 15px 18px;
        margin: 20px 0;
    }
    .article-content table {
        font-size: 13px;
    }
    .article-content table th,
    .article-content table td {
        padding: 10px 6px;
    }
}

/* 16. 超小螢幕優化 */
@media (max-width: 375px) {
    .article-content {
        padding: 12px;
        font-size: 14px;
    }
    .article-content h1 {
        font-size: 22px;
    }
    .article-content h2 {
        font-size: 20px;
    }
    .article-content h3 {
        font-size: 17px;
    }
}

/* 17. 列印樣式 */
@media print {
    .article-content {
        max-width: 100%;
        padding: 0;
    }
    .article-content a {
        text-decoration: underline;
        color: #000;
    }
    .article-content blockquote {
        border: 1px solid #000;
        background: #f9f9f9;
    }
}

/* 18. 暗色模式支援 */
@media (prefers-color-scheme: dark) {
    .article-content {
        color: #e0e0e0;
        background: #1a1a1a;
 }
.article-content h1,
    .article-content h2,
    .article-content h3,
    .article-content h4 {
        color: #fff;
    }
    .article-content p {
        color: #d0d0d0;
    }
    .article-content blockquote {
        background: #2a2a2a;
        border-left-color: #00a0d2;
        color: #b0b0b0;
    }
    .article-content table td {
        background: #2a2a2a;
        border-color: #444;
    }
    .article-content table tr:nth-child(even) td {
        background: #333;
    }
    .article-content table tr:hover td {
        background: #444;
    }
    .article-content code {
        background: #2a2a2a;
        border-color: #444;
        color: #ff6b6b;
    }
    .article-content pre {
        background: #1e1e1e;
        color: #d4d4d4;
    }
}

/* 19. 載入動畫 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.article-content > * {
    animation: fadeIn 0.6s ease-out forwards;
}

.article-content h1 { animation-delay: 0.1s; }
.article-content h2 { animation-delay: 0.2s; }
.article-content h3 { animation-delay: 0.3s; }
.article-content p { animation-delay: 0.4s; }
.article-content img { animation-delay: 0.5s; }

/* 20. 回到頂部按鈕 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #0073aa;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    text-align: center;
    line-height: 50px;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 115, 170, 0.4);
    transition: all 0.3s ease;
    z-index: 1000;
    display: none;
}

.back-to-top:hover {
    background: #00a0d2;
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 115, 170, 0.6);
}

@media (max-width: 768px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        line-height: 45px;
        font-size: 20px;
    }
}
