body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    overflow-x: hidden;
}

header {
    background-image: url('../images/background.png');
    background-size: cover;
    background-position: center;
    color: white;
    text-align: center;
    padding: 1rem 0;
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

header h1 {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 0;
}

.navbar {
    background-color: #f1f1f1;
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    border-bottom: 1px solid #ddd;
}
.navbar a {
    text-decoration: none;
    color: black;
    padding: 10px 20px;
}

iframe {
    width: 100%;
}

main {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 80vh;
    padding: 2rem;
}

.post-section {
    width: 100%;
    max-width: 1200px;
}

.banner {
    background-color: #f5f5f5;
    padding: 1rem;
    text-align: center;
    margin-bottom: 2rem;
    background-size: cover;
    background-position: center;
    color: white;
}

.image-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    overflow: hidden;
    width: 100%;
}

.image-container {
    position: relative;
    width: 50%;
}

.image-container img {
    width: 100%;
    max-width: 1000px;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateX(0%);
    transition: transform 0.3s ease;
}

.image-container img:hover {
    transform: scale(1.1);
}

.post-date {
    position: absolute;
    bottom: -10px;
    right: 0px;
    font-size: 1rem;
    color: white;
    background: rgba(0, 0, 0, 0.5);
    padding: 0.2rem 0.5rem;
    border-radius: 5px;
}

.text-container {
    background: white;
    padding: 2rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
    border: 1px solid #e6e6fa; /* 淡紫色邊框 */
}

h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: #4a4a4a;
    font-weight: bold;
    padding-left: 10px;
    border-left: 5px solid #9370db; /* 淡紫色邊框 */
    background-color: #f5f0ff; /* 淡紫色背景 */
    padding: 5px 10px;
    display: inline-block;
}

p {
    margin-bottom: 1.5rem;
    text-align: justify;
}

.tags {
    color: blue; 
    border: 1px solid blue; 
    padding: 5px; 
    display: inline-block;
    margin: 10px 0;
    border-radius: 5px;
    background-color: #f0f8ff;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .image-container {
        width: 90%;
    }
    
    .text-container {
        padding: 1rem;
        max-width: 90%;
    }

    h2 {
        font-size: 1.5rem;
        padding-left: 8px;
        padding: 4px 8px;
    }
    
    p {
        margin-bottom: 1rem;
    }
    
    .tags {
        padding: 3px 5px;
        font-size: 0.875rem;
    }
}

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

#progressbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 5px;
    background-color: #9370db; 
    z-index: 10;
}

.gallery {
    position: relative;
    max-width: 1000px;
    margin: auto;
}

.gallery img {
    width: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.gallery img.active {
    opacity: 1;
}

/* 新增樣式 */
#back-to-top {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99;
    border: none;
    outline: none;
    background-color: #555;
    color: white;
    cursor: pointer;
    padding: 15px;
    border-radius: 50%;
}

#back-to-top:hover {
    background-color: #333;
}

.social-share {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.share-btn {
    margin: 0 10px;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    color: white;
}

.facebook { background-color: #3b5998; }
.twitter { background-color: #1da1f2; }
.linkedin { background-color: #0077b5; }
.copy-link { background-color: #6a5acd; } 

.related-posts {
    margin-top: 30px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 5px;
}

.related-posts h3 {
    margin-bottom: 10px;
}

.related-posts ul {
    list-style-type: none;
    padding: 0;
}

.related-posts li {
    margin-bottom: 10px;
}

.tooltip {
    position: relative;
    display: inline-block;
    border-bottom: 1px dotted black;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px 0;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}