* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 導覽列 */
.navbar {
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    padding: 15px 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    color: #1a73e8;
}

.navbar nav a {
    text-decoration: none;
    color: #555;
    margin-left: 20px;
    font-weight: 500;
}

.navbar nav a.active {
    color: #1a73e8;
}

/* Hero 區塊 */
.hero {
    text-align: center;
    padding: 40px 0 20px;
}

.hero h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #202124;
}

.hero p {
    color: #5f6368;
}

/* 作者卡片網格 */
.authors-section {
    margin-top: 30px;
}

.authors-section h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    border-left: 4px solid #1a73e8;
    padding-left: 10px;
}

.author-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

/* 卡片單體 */
.author-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.author-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.card-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

/* 創作者頭像容器與圖片設定 */
.avatar {
    width: 60px;
    height: 60px;
    min-width: 60px;
    min-height: 60px;
    border-radius: 50%;
    object-fit: cover;
    background-color: #f1f5f9;
    overflow: hidden;
    display: block;
}

.author-info h3 {
    font-size: 1.1rem;
    margin-bottom: 4px;
    border: none;
    padding: 0;
}

.tag {
    font-size: 0.85rem;
    color: #1a73e8;
    background-color: #e8f0fe;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
}

.card-body {
    font-size: 0.95rem;
    color: #4a4a4a;
    margin-bottom: 20px;
    flex-grow: 1;
}

.btn-primary {
    display: block;
    text-align: center;
    background-color: #1a73e8;
    color: #fff;
    text-decoration: none;
    padding: 10px 0;
    border-radius: 6px;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-primary:hover {
    background-color: #1557b0;
}

/* 創作者簡介文字截斷 (最多 3 行) */
.card-body {
    font-size: 14px;
    color: #475569;
    line-height: 1.6;
    margin: 12px 0;    
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 67px; /* 保持卡片排版高度一致 */
}

/* 近七天日記打卡區塊 */
.author-diaries-section {
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px dashed #e2e8f0;
}

.section-title {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
}

.diary-dots {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

.diary-dot {
    flex: 1;
    height: 28px;
    background-color: #f1f5f9;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: #94a3b8;
    text-decoration: none;
    transition: all 0.2s;
}

/* 有日記的日期樣式 */
a.diary-dot.active {
    background-color: #e0f2fe;
    color: #0284c7;
    font-weight: bold;
    border: 1px solid #bae6fd;
}

a.diary-dot.active:hover {
    background-color: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
    transform: translateY(-1px);
}

/* 精選長文列表 */
.author-articles-section {
    margin-top: 10px;
}

.article-item {
    font-size: 13px;
    color: #334155;
    padding: 5px 0;
    border-bottom: 1px solid #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    text-decoration: none;
    transition: color 0.2s;
}

.article-item:hover {
    color: #2563eb;
    text-decoration: underline;
}
/* ==========================================
   post.html 雙欄版面與創作者專頁樣式
   ========================================== */

/* 1. 主要佈局容器 */
.post-layout-container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 300px 1fr; /* 左欄 300px，右欄自動填滿 */
    gap: 30px;
    align-items: start;
}

/* 2. 左側 Sidebar (創作者資訊與選單) */
.author-sidebar {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    position: sticky;
    top: 20px; /* 捲動時固定在頂部 */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.author-profile-card {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 20px;
}

.avatar-img {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 12px;
    border: 3px solid #e2e8f0;
}

.author-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
}

.author-school {
    font-size: 0.875rem;
    color: #0284c7;
    font-weight: 600;
    margin-bottom: 8px;
}

.author-bio {
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.5;
}

/* 3. 左側選單列表 */
.menu-section {
    margin-bottom: 20px;
}

.menu-section h3 {
    font-size: 0.9rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-list li {
    margin-bottom: 6px;
}

.menu-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 8px;
    color: #334155;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.menu-list a:hover, .menu-list a.active {
    background-color: #f1f5f9;
    color: #0284c7;
    font-weight: 600;
}

/* 🌟 付費文章標題特殊樣式 (金黃色醒目顯示) */
.menu-list a.paid-article {
    color: #d97706 !important; /* 琥珀金/橘黃色 */
    font-weight: 600;
}

.menu-list a.paid-article:hover {
    background-color: #fef3c7; /* 淡淡的金色背景 */
}

.price-tag {
    font-size: 0.75rem;
    background-color: #fef3c7;
    color: #b45309;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #fde68a;
}

/* 4. 右側主要內容展現區 */
.main-content-display {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 32px;
    min-height: 500px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* 5. 付費解鎖卡片樣式 (Paywall Card) */
.paywall-card {
    background: #fffbebf5;
    border: 2px dashed #f59e0b;
    border-radius: 12px;
    padding: 24px;
    margin-top: 24px;
    text-align: center;
}

.paywall-title {
    color: #b45309;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 12px;
}

.paywall-qr {
    max-width: 200px;
    height: auto;
    border-radius: 8px;
    margin: 15px 0;
    border: 1px solid #cbd5e1;
}

.payment-info-text {
    background: #ffffff;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #fed7aa;
    text-align: left;
    font-size: 0.95rem;
    color: #451a03;
    white-space: pre-wrap; /* 保持作者輸入的換行 */
    margin-bottom: 15px;
}

/* RWD 響應式：手機版改為單欄 */
@media (max-width: 768px) {
    .post-layout-container {
        grid-template-columns: 1fr;
    }
    .author-sidebar {
        position: static;
    }
}