/* static/css/home.css - 整理版 */

/* ========== 首頁整體 ========== */
.home-page {
    background: #f5f7fa;
    padding-bottom: 40px;
}

/* ========== 統一圖像處理 ========== */
img {
    max-width: 100%;
    height: auto;
}

/* 所有頭像強制正方形並居中裁剪 */
.user-avatar {
    object-fit: cover;
    object-position: center;
    background: #e0e0e0;
    flex-shrink: 0;
}

/* 所有書籍封面強制填滿容器 */
.book-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    background: #e0e0e0;
    transition: transform 0.3s;
}

/* 圖片加載失敗時的後備樣式 */
img:not([src]), 
img[src=""],
img[src="null"] {
    position: relative;
    background: linear-gradient(135deg, #667eea, #764ba2);
}

img:not([src])::after,
img[src=""]::after,
img[src="null"]::after {
    content: "📷";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    color: rgba(255,255,255,0.8);
}

/* 頭像加載失敗的後備 */
.user-avatar:not([src]),
.user-avatar[src=""],
.user-avatar[src="null"] {
    background: #667eea;
    position: relative;
}

.user-avatar:not([src])::after,
.user-avatar[src=""]::after,
.user-avatar[src="null"]::after {
    content: attr(data-initial);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    text-transform: uppercase;
}

/* ========== 輪播圖區域 ========== */
.hero-section {
    padding: 30px 0 0 0;
}

.carousel {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.carousel-image-wrapper {
    position: relative;
    background: #2c3e50;
    
}

.carousel-image-wrapper img {
    width: 100%;
    max-height: 360px;
    object-fit: cover;
    object-position: center;
}

.carousel-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
}

.carousel-caption {
    bottom: 30px;
    left: 40px;
    text-align: left;
    right: auto;
}

.carousel-tag {
    display: inline-block;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.carousel-caption h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.carousel-caption p {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 20px;
}

/* ========== 公告區域（最終版）========== */
.announcement-section {
    padding: 20px 0;
}

.announcement-bar {
    display: flex;
    align-items: flex-start;
    background: white;
    border-radius: 16px;
    padding: 20px 24px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    min-height: 140px;
    max-height: 160px;
    overflow: hidden;
}

.announcement-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.1rem;
    color: #333;
    padding-right: 24px;
    border-right: 2px solid #e0e0e0;
    flex-shrink: 0;
}

.announcement-header i {
    color: #667eea;
    font-size: 1.3rem;
}

.announcement-content {
    flex: 1;
    padding: 0 24px;
    overflow: hidden;
}

.announcement-carousel {
    position: relative;
    height: 100%;
    overflow: hidden;
}

.announcement-items {
    display: flex;
    flex-direction: column;
    animation: scrollAnnouncement 20s linear infinite;
}

.announcement-items:hover {
    animation-play-state: paused;
}

.announcement-slide-item {
    padding: 8px 0;
}

.announcement-slide-item .announcement-link {
    display: flex;
    align-items: center;
    color: #555;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.15s;
}

.announcement-slide-item .announcement-link:hover {
    color: #667eea;
}

.announcement-slide-item .badge-new {
    background: #e74c3c;
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 10px;
    font-weight: 600;
    flex-shrink: 0;
}

.announcement-more {
    color: #667eea;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    align-self: center;
    flex-shrink: 0;
    padding: 4px 8px;
}

.announcement-more:hover {
    text-decoration: underline;
}

@keyframes scrollAnnouncement {
    0% { transform: translateY(0); }
    100% { transform: translateY(-50%); }
}

/* ========== 區塊標題通用 ========== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-icon {
    font-size: 1.5rem;
    color: #667eea;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: #333;
}

.more-link {
    color: #999;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.15s;
}

.more-link:hover {
    color: #667eea;
}

/* ========== 本週強推區域 ========== */
.section-weekly {
    padding: 30px 0;
}

/* ========== 書籍卡片 ========== */
.book-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.book-cover-link {
    display: block;
    position: relative;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: #f0f0f0;
}

.book-card:hover .book-cover {
    transform: scale(1.05);
}

.badge-finished {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #27ae60;
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.book-info {
    padding: 15px;
}

.book-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.book-title a {
    color: #333;
    text-decoration: none;
}

.book-title a:hover {
    color: #667eea;
}

.book-author {
    color: #999;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.book-stats {
    display: flex;
    align-items: center;
    gap: 10px;
}

.heat {
    color: #e74c3c;
    font-size: 0.8rem;
}

.heat i {
    margin-right: 4px;
}

/* ========== 積分榜區域（最終版）========== */
.section-points {
    padding: 20px 0;
}

.points-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    overflow: hidden;
    height: 100%;
}

.points-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    font-weight: 600;
}

.points-card-header i {
    font-size: 1.2rem;
}

.points-card-header .badge-month {
    background: #f0f0f0;
    color: #666;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 8px;
}

.points-card-header .more-link {
    margin-left: auto;
}

.points-list {
    padding: 8px 0;
}

.points-item {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 1px solid #f5f5f5;
    gap: 10px;
}

.points-item:last-child {
    border-bottom: none;
}

.points-item .rank-num {
    width: 28px;
    font-weight: 700;
    color: #999;
    font-size: 1rem;
    text-align: center;
    flex-shrink: 0;
}

.points-item .rank-num.gold { color: #FFD700; }
.points-item .rank-num.silver { color: #C0C0C0; }
.points-item .rank-num.bronze { color: #CD7F32; }

.points-item .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    background: #e0e0e0;
    flex-shrink: 0;
}

.points-item .user-name-section {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.points-item .user-name {
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

/* ✅ 加寬的等級標籤 - 讀者 */
.points-item .reader-badge-wide {
    padding: 4px 12px !important;
    font-size: 0.75rem !important;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 85px;
    text-align: center;
}

/* ✅ 加寬的等級標籤 - 作者 */
.points-item .author-badge-wide {
    padding: 4px 12px !important;
    font-size: 0.75rem !important;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 85px;
    text-align: center;
}

.points-item .reader-badge,
.points-item .author-badge {
    flex-shrink: 0;
}

.points-item .user-points {
    font-weight: 700;
    color: #667eea;
    font-size: 0.95rem;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 60px;
    text-align: right;
}

/* ========== 5個排行榜一列 ========== */
.section-ranks {
    padding: 20px 0;
}

.ranks-row {
    display: flex;
    gap: 15px;
}

.rank-mini-card {
    flex: 1;
    background: white;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.rank-mini-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
    font-weight: 600;
    font-size: 0.9rem;
}

.rank-mini-header i {
    color: #667eea;
}

.rank-mini-header .badge-month {
    font-size: 0.7rem;
    color: #999;
    margin-left: auto;
    font-weight: 400;
}

.rank-mini-list {
    padding-top: 8px;
}

.rank-mini-item {
    display: flex;
    align-items: center;
    padding: 6px 0;
    text-decoration: none;
    color: #333;
    font-size: 0.85rem;
}

.rank-mini-item:hover {
    color: #667eea;
}

.rank-mini-item .rank-num {
    width: 20px;
    color: #999;
}

.rank-mini-item .book-title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========== 熱門作品區（最終版）========== */
.section-hot-works {
    padding: 30px 0;
}

.hot-works-layout {
    display: flex;
    gap: 20px;
    align-items: stretch;
}

.hot-works-slide {
    width: 280px;
    flex-shrink: 0;
}

.hot-works-slide .carousel {
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    background: white;
}

.hot-works-slide .carousel-inner,
.hot-works-slide .carousel-item {
    height: 100%;
}

.slide-book-card-large {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.slide-book-cover-large {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    object-position: center;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.slide-book-info-large {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.slide-book-info-large h5 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #333;
}

.slide-book-info-large p {
    color: #999;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.slide-book-info-large .book-desc {
    color: #666;
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 15px;
    flex: 1;
}

.slide-book-info-large .book-stats {
    display: flex;
    gap: 20px;
    margin-top: auto;
}

.slide-book-info-large .favorite {
    color: #667eea;
    font-weight: 500;
}

.hot-works-lists {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.hot-category-column {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    height: 100%;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
    font-weight: 600;
    font-size: 1rem;
}

.category-list {
    padding-top: 8px;
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    text-decoration: none;
    color: #333;
    font-size: 0.9rem;
    border-bottom: 1px solid #f5f5f5;
}

.category-item:last-child {
    border-bottom: none;
}

.category-item:hover {
    color: #667eea;
}

.category-item .item-title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-item .item-author {
    color: #999;
    font-size: 0.8rem;
    margin-left: 10px;
}

/* ========== 新書推薦 ========== */
.section-new-books {
    padding: 30px 0;
}

/* ========== 精選區域佈局（最終版）========== */
.section-finished,
.section-paid,
.section-free {
    padding: 30px 0;
}

.featured-layout {
    display: flex;
    gap: 20px;
    align-items: stretch;
}

.featured-slide-left {
    width: 280px;
    flex-shrink: 0;
}

.featured-slide-left .carousel {
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    background: white;
}

.featured-slide-left .carousel-inner,
.featured-slide-left .carousel-item {
    height: 100%;
}

.featured-main {
    flex: 1;
}

.featured-slide {
    display: none;
}

.slide-book-card-vertical {
    padding: 15px;
}

.slide-book-card-vertical .slide-book-cover {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    object-position: center;
    border-radius: 8px;
    background: #e0e0e0;
}

.slide-book-card-vertical .slide-book-info {
    padding: 12px 0 0 0;
}

.slide-book-card-vertical h5 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.slide-book-card-vertical p {
    color: #999;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.badge-paid, 
.badge-free,
.status.finished {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-paid {
    background: #fef3c7;
    color: #d97706;
}

.badge-free {
    background: #d1fae5;
    color: #059669;
}

.status.finished {
    background: #e8f5e9;
    color: #388e3c;
}

/* ========== 響應式設計 ========== */
@media (max-width: 1200px) {
    .hot-works-lists {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .ranks-row {
        flex-wrap: wrap;
    }
    
    .rank-mini-card {
        flex: 0 0 calc(20% - 12px);
    }
}

@media (max-width: 992px) {
    .carousel-image-wrapper,
    .carousel-image-wrapper img {
        height: 280px;
    }
    
    .carousel-caption h2 {
        font-size: 1.5rem;
    }
    
    .hot-works-layout {
        flex-direction: column;
    }
    
    .hot-works-slide {
        width: 100%;
        min-height: 400px;
    }
    
    .featured-layout {
        flex-direction: column;
    }
    
    .featured-slide-left {
        width: 100%;
        min-height: 400px;
    }
    
    .rank-mini-card {
        flex: 0 0 calc(33.33% - 10px);
    }
    
    .announcement-bar {
        flex-wrap: wrap;
        min-height: auto;
        max-height: none;
    }
    
    .announcement-header {
        border-right: none;
        padding-right: 0;
        margin-bottom: 15px;
        width: 100%;
    }
    
    .announcement-content {
        padding: 0;
        margin-bottom: 15px;
        width: 100%;
    }
    
    .announcement-more {
        width: 100%;
        text-align: right;
    }
}

@media (max-width: 768px) {
    .carousel-image-wrapper,
    .carousel-image-wrapper img {
        height: 200px;
    }
    
    .carousel-caption {
        bottom: 20px;
        left: 20px;
    }
    
    .carousel-caption h2 {
        font-size: 1.2rem;
    }
    
    .carousel-caption p {
        font-size: 0.85rem;
    }
    
    .rank-mini-card {
        flex: 0 0 calc(50% - 8px);
    }
    
    .hot-works-lists {
        grid-template-columns: 1fr;
    }
    
    .hot-works-slide,
    .featured-slide-left {
        min-height: 350px;
    }
    
    .announcement-bar {
        padding: 16px;
    }
    
    .section-header {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .points-item {
		display: flex;
		align-items: center;
		padding: 10px 20px;
		border-bottom: 1px solid #f5f5f5;
		gap: 10px;
	}
    
    .points-item .user-points {
        margin-left: 74px;
    }
}

@media (max-width: 576px) {
    .rank-mini-card {
        flex: 0 0 100%;
    }
    
    .carousel-image-wrapper,
    .carousel-image-wrapper img {
        height: 160px;
    }
    
    .carousel-caption .carousel-tag {
        display: none;
    }
    
    .carousel-caption p {
        display: none;
    }
}

/* 頭像連結 */
.user-avatar-link {
    display: block;
    flex-shrink: 0;
    text-decoration: none;
}

.user-avatar-link:hover .user-avatar {
    opacity: 0.8;
    transform: scale(1.05);
    transition: all 0.2s;
}

/* 用戶名稱連結 */
.user-name-link {
    text-decoration: none;
    color: inherit;
}

.user-name-link:hover .user-name {
    color: #667eea;
    text-decoration: underline;
}

.user-name {
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.15s;
}

/* 響應式 */
@media (max-width: 768px) {
    .points-item {
        flex-wrap: wrap;
    }
    
    .points-item .user-name-section {
        flex: 1;
    }
    
    .points-item .user-name {
        max-width: 100px;
    }
    
    .points-item .user-points {
        margin-left: 74px;
        width: 100%;
        text-align: left;
        margin-top: 5px;
    }
}

.section-ranks {
    padding: 20px 0;
}

.ranks-row {
    display: flex;
    gap: 12px;
}

.rank-mini-card {
    flex: 1;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.rank-mini-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 14px;
    border-bottom: 1px solid #f0f0f0;
    font-weight: 600;
    font-size: 0.9rem;
}

.rank-mini-header i {
    color: #667eea;
}

.rank-mini-header .badge-month {
    font-size: 0.7rem;
    color: #999;
    margin-left: auto;
    font-weight: 400;
}

.rank-mini-list {
    padding: 8px 0;
}

.rank-mini-item {
    display: flex;
    align-items: center;
    padding: 8px 14px;
    text-decoration: none;
    color: #333;
    font-size: 0.85rem;
    transition: background 0.15s;
}

.rank-mini-item:hover {
    background: #f8f9fa;
}

.rank-mini-item .rank-num {
    width: 22px;
    color: #999;
    font-weight: 600;
}

.rank-mini-item .book-title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rank-mini-item .rank-value {
    color: #667eea;
    font-weight: 600;
    font-size: 0.8rem;
    margin-left: 8px;
}

.rank-mini-footer {
    padding: 10px 14px;
    border-top: 1px solid #f0f0f0;
    text-align: right;
}

.rank-mini-footer .more-link {
    color: #999;
    text-decoration: none;
    font-size: 0.8rem;
}

.rank-mini-footer .more-link:hover {
    color: #667eea;
}

/* ========== 廣告容器 ========== */
.ad-container {
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    text-align: center;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ad-label {
    font-size: 0.7rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 0;
}

.ad-banner {
    min-height: 100px;
    max-height: 120px;
}

.ad-rectangle {
    min-height: 250px;
    max-height: 300px;
}

.ad-responsive {
    min-height: 100px;
}

/* 廣告容器內的 AdSense 元素 */
.ad-container ins {
    display: block;
    margin: 0 auto;
}

/* 響應式 */
@media (max-width: 1200px) {
    .ranks-row {
        flex-wrap: wrap;
    }
    
    .rank-mini-card {
        flex: 0 0 calc(20% - 10px);
    }
}

@media (max-width: 992px) {
    .rank-mini-card {
        flex: 0 0 calc(33.33% - 8px);
    }
}

@media (max-width: 768px) {
    .rank-mini-card {
        flex: 0 0 calc(50% - 6px);
    }
}

@media (max-width: 576px) {
    .rank-mini-card {
        flex: 0 0 100%;
    }
}

/* static/css/home.css - 添加廣告橫幅樣式 */

/* ========== 廣告橫幅 ========== */
.section-ad-banner {
    padding: 0 0 20px 0;
}

.section-ad-banner-top {
    padding: 20px 0 0 0;
}

.ad-banner-full {
    display: block;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    transition: all 0.3s;
    background: linear-gradient(135deg, #f5f7fa, #e8ecf1);
    min-height: 80px;
}

.ad-banner-full:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.ad-banner-full img {
    width: 100%;
    height: auto;
    max-height: 90px;
    object-fit: cover;
    object-position: center;
}

.ad-banner-full .ad-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    background: linear-gradient(135deg, #f5f7fa, #e8ecf1);
    color: #999;
    font-size: 0.9rem;
    border: 1px dashed #ccc;
    border-radius: 12px;
}

.ad-banner-full .ad-placeholder i {
    margin-right: 8px;
    color: #667eea;
}

/* 響應式 */
@media (max-width: 768px) {
    .ad-banner-full {
        min-height: 60px;
    }
    
    .ad-banner-full img {
        max-height: 60px;
    }
    
    .ad-banner-full .ad-placeholder {
        min-height: 60px;
    }
}

.ticker-section {
    padding: 15px 0;
}

.ticker-wrapper {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border-radius: 40px;
    padding: 8px 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    border: 1px solid #f0f0f0;
}

.ticker-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px 8px 16px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 30px;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.ticker-label i {
    font-size: 1rem;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.1); }
}

.ticker-container {
    flex: 1;
    overflow: hidden;
    margin-left: 16px;
    position: relative;
}

.ticker-container::before,
.ticker-container::after {
    content: '';
    position: absolute;
    top: 0;
    width: 30px;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.ticker-container::before {
    left: 0;
    background: linear-gradient(to right, #ffffff, transparent);
}

.ticker-container::after {
    right: 0;
    background: linear-gradient(to left, #ffffff, transparent);
}

.ticker-track {
    display: flex;
    align-items: center;
    gap: 40px;
    white-space: nowrap;
    animation: tickerScroll 30s linear infinite;
    padding: 8px 0;
}

.ticker-track:hover {
    animation-play-state: paused;
}

.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #555;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.ticker-item i {
    font-size: 1rem;
}

.ticker-item:hover {
    color: #667eea;
}

@keyframes tickerScroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* 女頻版本的主題色調整 */
.female-home-page .ticker-label {
    background: linear-gradient(135deg, #e83e8c, #ffb6c1);
}

.female-home-page .ticker-item:hover {
    color: #e83e8c;
}

/* 響應式 */
@media (max-width: 768px) {
    .ticker-wrapper {
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
    }
    
    .ticker-label {
        justify-content: center;
        margin-bottom: 10px;
    }
    
    .ticker-container {
        margin-left: 0;
    }
    
    .ticker-item {
        font-size: 0.85rem;
    }
}

/* 書籍封面佔位 */
.book-cover-placeholder {
    width: 100%;
    aspect-ratio: 3 / 4;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.book-cover-placeholder span {
    font-size: 2rem;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
}

/* Slide 封面佔位 */
.slide-cover-placeholder {
    width: 100%;
    aspect-ratio: 3 / 4;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.slide-cover-placeholder span {
    font-size: 3rem;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
}

/* 頭像佔位 */
.user-avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 16px;
    text-transform: uppercase;
    flex-shrink: 0;
}

/* ========== 熱門作品區 Slide 上下兩個 ========== */
.hot-works-layout {
    display: flex;
    gap: 20px;
    align-items: stretch;
}

.hot-works-slides {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.slide-block {
    flex: 1;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    background: white;
    min-height: 0;
}

.slide-block .carousel,
.slide-block .carousel-inner,
.slide-block .carousel-item {
    height: 100%;
}

.slide-book-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 15px;
}

.slide-book-cover {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    object-position: center;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin-bottom: 12px;
    background: #e0e0e0;
}

.slide-book-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.slide-book-info h6 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.slide-book-info p {
    color: #999;
    font-size: 0.85rem;
    margin-bottom: 6px;
}

.slide-book-info .heat {
    color: #e74c3c;
    font-size: 0.85rem;
    font-weight: 500;
}

.hot-works-lists {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    align-content: start;
}

/* 積分榜 - 顯示總榜，不分男女 */
.points-card-header .badge-total {
    background: #f0f0f0;
    color: #666;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 12px;
    margin-left: 8px;
}

/* 分類標題中的 "更多" 箭頭 */
.cat-more {
    color: #999;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: color 0.15s;
}

.cat-more:hover {
    color: #667eea;
}

