:root {
    --primary: #FF385C;
    --secondary: #FF5C8A;
    --background: #FFF6F9;
    --card-bg: #FFFFFF;
    --text: #2C3E50;
    --text-light: #7F8C8D;
    --shadow: 0 8px 30px rgba(0,0,0,0.12);
    --gradient: linear-gradient(135deg, var(--primary), var(--secondary));
}

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

body {
    font-family: 'Noto Sans SC', sans-serif;
    background-color: var(--background);
    color: var(--text);
    line-height: 1.6;
}

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
.header {
    background: var(--gradient);
    color: white;
    padding: 3rem 1rem;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

/* 控制栏样式 */
.controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 800px;
    margin: 0 auto;
}

.search-wrapper {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
}

.search-wrapper input,
.filter-wrapper select {
    width: 100%;
    padding: 0.8rem 1.2rem;
    border: none;
    border-radius: 12px;
    background: rgba(255,255,255,0.9);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-wrapper input {
    padding-left: 2.5rem;
}

.filter-wrapper {
    display: flex;
    gap: 1rem;
}

/* 主要内容区域 */
.main {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* 书籍网格布局 */
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    padding: 1rem;
}

/* 书籍卡片样式 */
.book-card {
    background: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.book-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.book-cover {
    position: relative;
    padding-top: 140%;
    background: #f0f0f0;
    overflow: hidden;
}

.book-cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
    opacity: 0;
    z-index: 2;
}

.book-cover img.loaded {
    opacity: 1;
}

.book-cover::before {
    content: '\f03e';
    font-family: 'Font Awesome 6 Free';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: #ddd;
    z-index: 1;
}

/* 书籍信息样式 */
.book-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.2rem;
    background: linear-gradient(
        180deg,
        rgba(255,255,255,0.9) 0%,
        rgba(255,255,255,1) 100%
    );
}

.book-header {
    margin-bottom: 0.5rem;
}

.book-title {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text);
}

.book-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.book-author, 
.book-publish {
    color: var(--text-light);
    font-size: 0.95rem;
}

.rating-score {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    font-weight: 500;
}

.rating-score i {
    color: #FFD700;
}

.rating-people {
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: normal;
}

/* 查看详情按钮 */
.book-action {
    margin-top: auto;
    text-align: center;
    padding-top: 1.5rem;
}

.book-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.book-link:hover {
    background: var(--secondary);
    transform: translateY(-2px);
}

/* 页脚样式 */
.footer {
    background: white;
    padding: 2rem;
    text-align: center;
    border-top: 1px solid rgba(0,0,0,0.1);
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.footer-info {
    margin-bottom: 1rem;
    color: var(--text-light);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.footer-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-link:hover {
    color: var(--secondary);
}

/* 图标通用样式 */
.fas {
    margin-right: 0.5rem;
}

/* 加载状态 */
.loading-placeholder {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header {
        padding: 2rem 1rem;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .filter-wrapper {
        flex-direction: column;
    }
    
    .main {
        padding: 1rem;
    }
    
    .book-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1.5rem;
    }
    
    .book-info {
        padding: 1.2rem;
    }
    
    .book-action {
        padding-top: 1.2rem;
    }
}