:root {
    --header-space: 40px;
}

/* 基本重設 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
}

body {
    font-family: 'Open Sans', sans-serif;
    color: #222;
    padding-top: var(--header-space);
    padding-bottom: var(--header-space);
    background: #f5f6f7;
}

/* header */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: #fff;
    z-index: 9999;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    height: var(--header-space);
    display: flex;
    align-items: center;
}

header h1 {
    color: #c7207c;
    /* 桃紅色 */
    font-weight: 700;
    font-size: 30px;
    margin: 0;
}

header h1 a {
    color: #c7207c !important;
    /* 桃紅色，強制覆蓋 */
    text-decoration: none !important;
    /* 去掉下劃線 */
    display: inline-block;
}
.article-card {
    text-decoration: none; /* 移除 a 的底線 */
}

.article-card h3 {
    color: #f069d3; /* 粉紅色 */
   
}


/* header 內部容器 */
.header-inner {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* 導覽列 */
.main-nav {
    display: flex;
    gap: 15px;
    align-items: center;
}

.main-nav a {
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 4px;
}

.main-nav a:hover {
    background: #e6f0ff;
}

/* footer */
footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #f8f9fa;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.05);
    height: var(--header-space);
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

footer p {
    margin: 0;
    padding: 0 20px;
    font-size: 0.95rem;
    color: #555;
}

footer a.footer-aya {
    color: #c7207c;
    font-size: 1.1em;
    text-decoration: none;
}

footer a.footer-aya:hover {
    text-decoration: underline;
}

/* container */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 15px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.04);
}

/* 主圖 */
.main-image img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

/* 文章文字 */
.article-text {
    margin-top: 0.5rem;
    font-size: 1.4rem;
    line-height: 1.6;
    color: #222;
    text-align: left;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* 文章列表卡片 */
.article-card {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow .18s;
}

.article-card:hover {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.article-card img {
    width: 160px;
    height: 100px;
    object-fit: cover;
}

.article-card .text {
    padding: 10px;
    flex: 1;
}

.article-card .text h3 {
    font-size: 1.4rem;
    margin: 0 0 5px 0;
    text-align: center;
}

.article-card .text .card-date,
.article-card .text .card-excerpt {
    font-size: 1rem;
    color: #555;
    text-align: left;
}

/* 上一篇 / 下一篇置中 */
.post-nav {
    text-align: center;
    margin: 2rem 0;
}

.post-nav a {
    display: inline-block;
    margin: 0 1rem;
    padding: 5px 10px;
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
}

.post-nav a:hover {
    text-decoration: underline;
}

/* 手機版專用文字列 */
@media (max-width:768px) {
    .mobile-subtitle {
        display: block;
        text-align: center;
        font-size: 1.2rem;
        font-weight: 600;
        color: #007bff;
        padding: 5px 0;
    }

    /* 導覽列手機版換行置中 */
    .main-nav {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
        margin-left: 0;
    }

    .main-nav a {
        padding: 6px 10px;
        font-size: 1rem;
    }

    /* 手機版 header h1 a 強制套用顏色 */
    header h1 a {
        color: #c7207c !important;
        text-decoration: none !important;
    }
}

/* 電腦版隱藏 */
@media (min-width:769px) {
    .mobile-subtitle {
        display: none;
    }
}
@media (max-width:768px) {

    /* 禁止手機版橫向滑動 */
    body {
        overflow-x: hidden;
    }

    /* container 不超出螢幕 */
    .container {
        max-width: 100%;
        padding-left: 15px;
        padding-right: 15px;
        box-sizing: border-box;
    }

    /* 文章卡片改為垂直排列，避免溢出 */
    .article-card {
        flex-direction: column;
        width: 100%;
    }

    /* 卡片內圖片自動縮放 */
    .article-card img {
        width: 100%;
        height: auto;
        object-fit: cover;
    }

    /* 主圖圖片最大寬度限制 */
    .main-image img {
        max-width: 100%;
        height: auto;
    }

    /* 確保文章文字不被推出螢幕 */
    .article-text {
        word-break: break-word;
    }
}