/* === 作者資訊區塊 === */
.author-box-container {
    margin: 40px 0;
    padding: 30px;
    background: #fafafa;
    border-radius: 8px;
    border: 1px solid #eee;
}
.ab-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end; /* Align tabs to bottom */
    border-bottom: 2px solid #e5e5e5;
    margin-bottom: 25px;
    /* padding-bottom: 10px; Removed to align tabs with border */
    flex-wrap: wrap;
    gap: 15px;
}
.ab-tabs { 
    display: flex; 
    gap: 20px; 
    margin-bottom: -2px; /* Overlap active line with border */
}
.ab-tab-btn {
    background: none; 
    border: none; 
    font-size: 1rem; 
    font-weight: 600;
    color: #333; 
    cursor: pointer; position: relative; padding: 0 0 15px 0;
}
.ab-tab-btn.active { color: #e91e63; }
.ab-tab-btn .post-count {
    background: #e91e63;
    color: #fff;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 5px;
    vertical-align: middle;
    transition: all 0.3s ease;
    font-weight: normal;
}
.ab-tab-btn.active::after {
    content: ''; position: absolute; bottom: 0px; left: 0; width: 100%;
    height: 3px; background: #e91e63; z-index: 1;
}
.ab-actions { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
    padding-bottom: 15px; /* Align with tab text baseline */
}

/* 視圖切換按鈕 */
.ab-view-toggle {
    display: none; /* 預設隱藏，切換到最近文章頁籤時由 JS 顯示 */
    gap: 4px; 
    background: #fff; 
    padding: 3px; 
    border: 1px solid #ddd; 
    border-radius: 4px; 
    transition: opacity 0.3s ease;
}
.ab-view-btn {
    background: none; border: none; padding: 4px 6px; cursor: pointer; color: #999; display: flex;
}
.ab-view-btn.active { background: #e91e63; color: #fff; border-radius: 3px; }

/* 文章一覽表連結 - 按鈕風格 */
.ab-view-all { 
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    text-decoration: none;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    transition: all 0.2s ease;
}
.ab-view-all svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}
.ab-view-all:hover { 
    color: #e91e63;
    background: #fff;
    border-color: #e91e63;
}
.ab-view-all:hover svg {
    transform: translateX(2px);
}

/* Tab 內容 */
.ab-content { display: none; animation: fadeIn 0.5s; }
.ab-content.active { display: block; }
@keyframes fadeIn { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:translateY(0); } }

/* 作者內容 - 採用 author.php 風格 */
.ab-author-wrap { 
    display: grid;
    grid-template-columns: 0.26fr 1fr;
    grid-template-rows: auto;
    gap: 0 20px; /* 增加欄位間距 */
    grid-template-areas: 
        "avatar content"
        "avatar social";
    background: #fff;
    padding: 20px; /* 增加內部間距 */
}
.ab-avatar { 
    grid-area: avatar;
    padding: 20px; /* 增加內距 */
    display: flex;
    align-items: flex-start; /* 圖片靠上 */
}
.ab-avatar a {
    pointer-events: none; /* 禁用頭像連結 */
    cursor: default;
}
.ab-avatar img { 
    border-radius: 50%; 
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    border: none;
}
.ab-info {
    grid-area: content;
    padding: 20px 15px 10px; /* 上、左右、下間距 */
    background: #fff;
    word-break: break-all;
    word-wrap: break-word;
}
.ab-name { 
    margin: 0 0 10px; /* 增加下方間距 */
    font-size: 1.25rem;
    font-weight: 900;
    letter-spacing: 2px;
    line-height: 1.8;
    text-align: left;
    display: block;
}
.author-post-count {
    background: #e91e63;
    color: #fff;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: normal;
    margin-left: 10px;
    display: inline-block;
}
.ab-bio { 
    margin: 0 0 15px; /* 增加下方間距 */
    color: #666; 
    line-height: 1.8;
}

.ab-bio p { 
    font-size: 1rem;
}

/* 作者社群按鈕區域 */
.ab-social-area {
    grid-area: social;
    padding: 10px 15px;
    opacity: 0.8;
}

/* 作者社群按鈕 */
.ab-social-links {
    display: flex;
    gap: 8px;
    margin: 0; /* 移除 margin，由父元素控制 */
    flex-wrap: wrap;
}
.ab-social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 16px; /* pill shape */
    color: #fff !important;
    text-decoration: none !important; /* 移除底線 */
    border: 1px solid transparent;
    transition: all 0.2s ease;
}
.ab-social-btn i {
    font-size: 14px;
    color: #fff !important;
}
.ab-social-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
    text-decoration: none !important; /* hover 時也不要底線 */
}

/* 移除所有 author box 內連結的底線 */
.author-box-container a {
    text-decoration: none;
}
.author-box-container a:hover {
    text-decoration: none !important;
}

/* 文章列表 (預設清單) */
.ab-posts-list { display: flex; flex-direction: column; gap: 20px; }
.ab-posts-list.view-list .ab-post-item { flex-direction: row; align-items: flex-start; }
.ab-post-item {
    display: flex;
    align-items: center;
    gap: 20px;
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #eee;
}
.ab-post-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.ab-post-item[data-clickable="true"] {
    cursor: pointer;
}
.ab-post-item[data-clickable="true"]:hover {
    border-color: #e91e63;
}
.ab-thumb img { width: 120px; height: 80px; object-fit: cover; border-radius: 4px; }
.ab-post-info { flex: 1; }
.ab-meta { font-size: 12px; color: #999; margin-bottom: 5px; }
.ab-post-date { color: #e91e63; }
.ab-post-title { margin: 0 0 5px; font-size: 16px; }
.ab-post-title a { text-decoration: none; color: #333; }
.ab-excerpt { font-size: 13px; color: #777; margin: 0; line-height: 1.5; }

/* 文章列表 (網格模式) */
.ab-posts-list.view-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px;
}
.ab-posts-list.view-grid .ab-post-item { flex-direction: column; gap: 10px; }
.ab-posts-list.view-grid .ab-thumb img { width: 100%; height: 140px; }

/* 查看更多按鈕 */
.ab-view-more-container {
    text-align: center;
    margin-top: 20px;
    grid-column: 1 / -1; /* Ensure it spans full width in grid */
}
.ab-view-more-btn {
    display: inline-block;
    padding: 8px 25px;
    background: #fff;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}
.ab-view-more-btn:hover {
    background: #e91e63;
    color: #fff;
    border-color: #e91e63;
}

/* === 社群互動區塊 === */
.social-box-wrapper { margin: 40px 0; }
.social-box-container {
    display: flex; gap: 20px; padding: 25px; background: #4a4a4a;
    color: #fff; border-radius: 8px; align-items: center;
}
.sb-image img { width: 250px; border-radius: 6px; display: block; }
.sb-content { flex: 1; text-align: center; }
.sb-title { font-size: 22px; margin: 0 0 5px; color: #fff; }
.sb-subtitle { margin: 0 0 20px; opacity: 0.9; }
.sb-buttons { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.sb-btn {
    display: inline-flex; justify-content: center; align-items: center;
    padding: 10px 25px; border-radius: 4px; text-decoration: none; color: #fff;
    font-weight: bold; min-width: 200px; transition: transform 0.2s;
}
.sb-btn:hover { transform: translateY(-2px); color: #fff; }
.sb-share-btn.facebook, .sb-follow-btn.facebook { background: #1877f2; }
.sb-share-btn.line { background: #00c300; }
.sb-share-btn.twitter { background: #1da1f2; }
.sb-follow-btn.google_news_follow { background: #4285f4; }

/* GN 橫幅 */
.gn-banner {
    margin-top: 20px; background: #e8f0fe; padding: 15px; border-radius: 6px;
    text-align: center; border: 1px solid #d2e3fc;
}
.gn-banner a { text-decoration: none; color: #1967d2; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 10px; }
.gn-icon { width: 24px; height: 24px; }

@media (max-width: 768px) {
    .author-box-container {
        padding: 20px;
        margin: 30px 0;
    }

    /* Header Stacking & Centering */
    .ab-header {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .ab-tabs {
        width: 100%;
        justify-content: center; /* Center tabs */
        flex-wrap: wrap;
    }
    
    .ab-actions {
        width: 100%;
        justify-content: center; /* Center actions */
        flex-wrap: wrap; /* 允許換行 */
    }
    
    .ab-view-all {
        width: 100%; /* RWD 時全寬 */
        justify-content: center;
        margin-top: 10px;
    }

    /* Author Info Stacking & Centering */
    .ab-author-wrap {
        grid-template-columns: 1fr;
        grid-template-areas: 
            "avatar"
            "content"
            "social";
        text-align: center;
        border: 15px solid #f1f1f1;
        padding: 15px; /* RWD 時減少內距 */
        gap: 15px 0; /* RWD 時增加行間距 */
    }
    
    .ab-avatar {
        padding: 0;
        justify-content: center; /* 圖片置中 */
    }
    
    .ab-avatar img {
        width: 80px;
        height: 80px;
        margin: 0;
    }
    
    .ab-info {
        padding: 15px 10px;
    }
    
    .ab-name {
        text-align: center;
        margin-bottom: 15px;
    }
    
    .ab-bio {
        text-align: center;
        margin-bottom: 20px;
    }
    
    .ab-social-links {
        justify-content: center; /* 社群按鈕置中 */
    }
    
    .ab-social-icons {
        justify-content: center;
    }

    /* Post List - Keep horizontal but ensure it fits */
    .ab-posts-list.view-list .ab-post-item {
        flex-direction: row;
        align-items: center;
    }
    
    .ab-post-item {
        flex-direction: row;
        align-items: center;
    }
    
    .ab-thumb img {
        width: 100px;
        height: 70px;
        margin-bottom: 0;
        margin-right: 15px;
    }
    
    .ab-post-info {
        width: auto;
        flex: 1;
    }

    /* Social Box RWD (Legacy support) */
    .social-box-container { flex-direction: column; }
    .sb-image img { width: 100%; }
}