:root {
    --primary-color: #39C5BB; /* Miku 蔥綠色 */
    --secondary-color: #f0fbfb; /* 極淺綠背景 */
    --accent-color: #FF69B4; /* 髮飾粉紅色 */
    --text-color: #2c3e50;
    --card-bg: #ffffff;
    --header-gradient: linear-gradient(135deg, #39C5BB 0%, #29a69e 100%);
    --shadow: 0 8px 20px rgba(57, 197, 187, 0.15);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "PingFang TC", "Microsoft JhengHei", sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--secondary-color);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

header {
    background: var(--header-gradient);
    color: white;
    padding: 30px 0;
    text-align: center;
    margin-bottom: 40px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-bottom: 5px solid var(--accent-color); /* Miku 髮圈點綴 */
    position: relative;
    overflow: hidden;
}

header h1 a {
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: 2px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.status {
    text-align: center;
    font-size: 1.2rem;
    padding: 20px;
    color: var(--primary-color);
}

.hidden {
    display: none !important;
}

/* 加載動畫樣式 */
.loader-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 50px;
}

.loader {
    width: 48px;
    height: 48px;
    border: 5px solid var(--primary-color);
    border-bottom-color: transparent;
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

@keyframes rotation {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    padding-bottom: 50px;
}

.news-card {
    background: var(--card-bg);
    border-radius: 20px; /* 更圓潤的設計 */
    box-shadow: var(--shadow);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    border: 1px solid rgba(57, 197, 187, 0.1);
}

.news-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 15px 35px rgba(57, 197, 187, 0.25);
    border-color: var(--primary-color);
}

.news-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background-color: #eee;
}

.news-card-content {
    padding: 20px;
    background: #fff;
}

.news-card h3 {
    font-size: 1.15rem;
    margin: 0;
    color: var(--text-color);
    line-height: 1.5;
}

/* 內容頁樣式 */
.news-detail {
    background: white;
    padding: 40px;
    border-radius: 24px;
    box-shadow: var(--shadow);
    border-left: 8px solid var(--primary-color);
}

.back-btn {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    margin-bottom: 25px;
    transition: color 0.2s;
}

.back-btn:hover {
    color: var(--accent-color);
}

.detail-image {
    width: 100%;
    border-radius: 16px;
    margin: 20px 0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.article-inline-media {
    margin: 24px 0 32px;
}

.article-inline-media a {
    color: var(--primary-color);
}

.article-inline-media img {
    width: 100%;
    display: block;
    border-radius: 16px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.article-inline-media figcaption {
    margin-top: 10px;
    font-size: 0.95rem;
}

/* 分頁按鈕 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 60px;
}

.page-btn {
    width: 45px;
    height: 45px;
    border: 2px solid var(--primary-color);
    background: white;
    color: var(--primary-color);
    border-radius: 50%; /* 圓形按鈕 */
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-btn.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 10px rgba(57, 197, 187, 0.4);
}

.page-btn:hover:not(.active) {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

footer {
    background: var(--text-color);
    color: rgba(255,255,255,0.7);
    text-align: center;
    padding: 40px 0;
}

@media (max-width: 600px) {
    header h1 a { font-size: 2rem; }
    .news-grid { grid-template-columns: 1fr; }
    .news-detail { padding: 20px; }
}
