/* 全域設定 */
body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    background: #fefaf3;
}

/* 容器 */
.container {
    width: 90%;
    max-width: 1000px;
    margin: auto;
}

/* 🌟 桌機版 (Desktop) */
@media (min-width: 768px) {
    .hero.desktop {
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: #E9C46A;
        padding: 20px 50px;
        border-radius: 10px;
        margin-bottom: 20px;
        text-align: left;
        box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
    }

    .hero.desktop .hero-text {
        max-width: 60%;
    }

    .hero.desktop .hero-image img {
        width: 250px;
        height: auto;
        border-radius: 50%;
        box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
    }

    /* ✅ 桌機上隱藏手機版 */
    .hero.mobile {
        display: none !important;
    }
}

/* 📱 手機版 (Mobile) */
@media (max-width: 767px) {
    .hero.desktop {
        display: none !important;
        /* ✅ 手機上隱藏桌機版 */
    }

    .hero.mobile {
        display: flex;
        flex-direction: column;
        text-align: center;
        padding: 20px;
        background: #E9C46A;
        border-radius: 10px;
        margin-bottom: 20px;
        box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
        /*
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: #E9C46A;
        padding: 10px;
        border-radius: 15px;
        margin-bottom: 20px;
        text-align: left;   
        */
    }

    .hero-text {
        max-width: 100%;
        margin-bottom: 10px;
    }

    .hero-image {
        display: flex;
        justify-content: center;
        align-items: center;
        margin: 15px 0;
        /* 讓圖片與文字保持間距 */
    }

    .hero-image img {
        width: 200px;
        /* 調整圖片大小 */
        height: 120px;
        /* 讓圖片變成橢圓形 */
        border-radius: 50% / 40%;
        object-fit: cover;
        box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
        background: linear-gradient(135deg, #FFD3A5, #FD6585);
        padding: 5px;
    }

    .btn {
        margin-top: 20px;
    }
}

.btn {
    display: inline-block;
    background: #2A9D8F;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    font-weight: bold;
    border-radius: 25px;
    margin-top: 15px;
    transition: 0.3s;
}

.btn:hover {
    background: #1E706D;
}

/* 內容區塊（最新筆友、熱門文章、熱門日記、最新問題） */
.latest-penpals,
.popular-articles,
.popular-diaries,
.latest-issues {
    margin-bottom: 20px;
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
}

.latest-penpals h2,
.popular-articles h2,
.popular-diaries h2,
.latest-issues h2 {
    color: #E76F51;
    border-bottom: 2px solid #E76F51;
    padding-bottom: 5px;
}

/* 清單樣式 */
.latest-penpals ul,
.popular-articles ul,
.popular-diaries ul,
.latest-issues ul {
    list-style: none;
    padding: 0;
}

.latest-penpals li,
.popular-articles li,
.popular-diaries li,
.latest-issues li {
    padding: 5px 0;
}

.latest-penpals a,
.popular-articles a,
.popular-diaries a,
.latest-issues a {
    text-decoration: none;
    color: #264653;
    font-weight: bold;
    transition: 0.3s;
}

.latest-penpals a:hover,
.popular-articles a:hover,
.popular-diaries a:hover,
.latest-issues a:hover {
    color: #E76F51;
}

/* 📌 美化最新筆友區塊 */
.penpal-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 🎨 讓筆友整個區塊變成超連結 */
.penpal-item {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease-in-out;
}

.penpal-item:hover {
    transform: scale(1.02);
}

/* ✅ 讓筆友區塊可點擊 */
.penpal-link {
    display: block;
    padding: 15px;
    text-decoration: none;
    color: inherit;
}

/* 📌 讓 `nickname` 和 `國家` 靠在一起 */
.penpal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    /* ✅ 減少 `nickname` 與 `國家` 之間的距離 */
    font-size: 18px;
    font-weight: bold;
    color: #333;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

/* 👤 筆友名稱 */
.penpal-name {
    font-size: 18px;
    color: #333;
}

/* 🌍 國家名稱 + 國旗 */
.penpal-country {
    font-size: 16px;
    color: #666;
}

/* 💬 個性簽名 */
.penpal-oneword {
    font-size: 14px;
    color: #444;
    margin-top: 10px;
    background: #f9f9f9;
    padding: 8px;
    border-left: 4px solid #ff7b54;
    border-radius: 5px;
}

/* 📱 響應式設計（手機） */
@media (max-width: 768px) {
    .penpal-item {
        padding: 12px;
    }

    .penpal-header {
        flex-wrap: wrap;
        /* ✅ 在小螢幕上自動換行 */
    }

    .penpal-name {
        font-size: 16px;
    }

    .penpal-country {
        font-size: 14px;
    }

    .penpal-oneword {
        font-size: 13px;
    }
}

/* ⛔ 沒有筆友時的訊息 */
.no-penpals {
    text-align: center;
    font-size: 16px;
    color: #999;
    margin-top: 20px;
}


/* 📌 安全提示區塊 */
.safety-tips {
    background: #FFEBE8;
    /* 溫和紅色背景 */
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.1);
    text-align: left;
    max-width: 1200px;
    margin: 20px auto;
    border-left: 5px solid #E63946;
    /* 左側紅色標記條 */
    position: relative;
    font-size: 16px;
}

/* ⚠️ 標題樣式 */
.safety-tips h2 {
    font-size: 20px;
    color: #D62828;
    /* 深紅色 */
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

/* 🚨 標題內的圖示 */
.safety-tips h2::before {
    content: "⚠️";
    font-size: 24px;
    margin-right: 8px;
}

/* 內容文字 */
.safety-tips p {
    font-size: 15px;
    color: #333;
    margin: 0;
    line-height: 1.6;
}

/* 💡 提示內的圖示 */
.safety-tips p::before {
    content: "💡";
    font-size: 18px;
    margin-right: 5px;
}

/* 響應式設計（適應小螢幕） */
@media (max-width: 768px) {
    .safety-tips {
        font-size: 14px;
        padding: 12px;
    }

    .safety-tips h2 {
        font-size: 18px;
    }
}

.latest-announcements {
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.latest-announcements h2 {
    color: #E63946;
    border-bottom: 2px solid #E63946;
    padding-bottom: 5px;
    margin-bottom: 15px;
}

#announcement-list {
    list-style: none;
    padding: 0;
}

.announcement-item {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease-in-out;
    padding: 15px;
    margin-bottom: 10px;
}

.announcement-item:hover {
    transform: scale(1.02);
}

.announcement-title {
    font-size: 18px;
    font-weight: bold;
    color: #E63946;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
    margin-bottom: 5px;
}

.announcement-date {
    font-size: 14px;
    color: #888;
}

.announcement-text {
    font-size: 16px;
    color: #333;
    margin-top: 5px;
}

.toggle-btn {
    background: none;
    border: none;
    color: #E63946;
    font-weight: bold;
    cursor: pointer;
    margin-left: 5px;
    /* ✅ 按鈕與內文間距 */
    display: inline;
    /* ✅ 讓按鈕緊接著內文 */
    font-size: 16px;
}

.toggle-btn:hover {
    text-decoration: underline;
}