/* 重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', 'Baloo 2', cursive;
    background: linear-gradient(135deg, #FFE5E5 0%, #E5F3FF 100%);
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
}

/* 应用头部 */
.app-header {
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E8E 100%);
    padding: 15px 20px;
    box-shadow: 0 4px 20px rgba(255, 107, 107, 0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 400px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    color: white;
    font-size: 1.5rem;
    font-weight: 800;
}

.logo i {
    margin-right: 8px;
    font-size: 1.8rem;
}

.header-actions {
    display: flex;
    gap: 15px;
}

.search-btn, .user-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.2rem;
    padding: 10px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn:hover, .user-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* 搜索容器 */
.search-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 107, 107, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1001;
    padding: 15px;
    transition: all 0.3s ease;
}

.search-bar {
    display: flex;
    align-items: center;
    max-width: 400px;
    margin: 0 auto;
    background: white;
    border-radius: 25px;
    padding: 5px 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.search-bar input {
    flex: 1;
    border: none;
    padding: 10px;
    font-size: 1rem;
    outline: none;
}

.close-search {
    background: none;
    border: none;
    color: #FF6B6B;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
}

/* 主要内容区域 */
.main-content {
    padding: 20px;
    padding-bottom: 80px;
    max-width: 400px;
    margin: 0 auto;
}

/* 欢迎横幅 */
.welcome-banner {
    background: linear-gradient(135deg, #FFE66D 0%, #FF8E8E 100%);
    border-radius: 20px;
    padding: 30px 20px;
    margin-bottom: 25px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(255, 230, 109, 0.3);
}

.banner-content h1 {
    color: #333;
    font-size: 1.8rem;
    margin-bottom: 5px;
    font-weight: 700;
}

.banner-content p {
    color: #666;
    font-size: 1rem;
    margin-bottom: 15px;
}

.floating-elements {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.star, .cloud, .heart {
    position: absolute;
    font-size: 1.5rem;
    animation: float 3s ease-in-out infinite;
}

.star {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.cloud {
    top: 20%;
    right: 15%;
    animation-delay: 1s;
}

.heart {
    bottom: 20%;
    left: 20%;
    animation-delay: 2s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(5deg); }
}

/* 年龄分类 */
.age-categories {
    margin-bottom: 30px;
}

.age-categories h2 {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 15px;
    font-weight: 600;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.category-card {
    background: white;
    border-radius: 15px;
    padding: 15px 10px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.category-icon {
    font-size: 2rem;
    margin-bottom: 5px;
}

.category-card span {
    font-size: 0.8rem;
    color: #666;
    font-weight: 500;
}

/* 推荐绘本 */
.recommended-books {
    margin-bottom: 30px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-header h2 {
    font-size: 1.3rem;
    color: #333;
    font-weight: 600;
}

.view-all-btn {
    background: none;
    border: none;
    color: #FF6B6B;
    font-size: 0.9rem;
    cursor: pointer;
    font-weight: 500;
}

.book-scroll {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.book-scroll::-webkit-scrollbar {
    display: none;
}

.book-card {
    flex: 0 0 auto;
    width: 140px;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.book-cover {
    position: relative;
    height: 160px;
    overflow: hidden;
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #FF6B6B;
    color: white;
    padding: 4px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
}

.book-badge.new {
    background: #4ECDC4;
}

.book-info {
    padding: 12px;
}

.book-info h3 {
    font-size: 0.9rem;
    margin-bottom: 4px;
    font-weight: 600;
}

.book-info p {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 8px;
}

.book-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.age-tag {
    background: #FFE5E5;
    color: #FF6B6B;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 500;
}

.rating {
    display: flex;
    align-items: center;
    gap: 2px;
}

.rating i {
    color: #FFD700;
    font-size: 0.8rem;
}

.rating span {
    font-size: 0.7rem;
    color: #666;
}

/* 主题分类 */
.theme-categories {
    margin-bottom: 30px;
}

.theme-categories h2 {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 15px;
    font-weight: 600;
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.theme-card {
    background: white;
    border-radius: 15px;
    padding: 25px 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.theme-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.theme-card.adventure {
    background: linear-gradient(135deg, #FFE66D 0%, #FF8E8E 100%);
}

.theme-card.animals {
    background: linear-gradient(135deg, #96CEB4 0%, #FFEAA7 100%);
}

.theme-card.friendship {
    background: linear-gradient(135deg, #DDA0DD 0%, #98D8C8 100%);
}

.theme-card.magic {
    background: linear-gradient(135deg, #A8E6CF 0%, #FFD3A5 100%);
}

.theme-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.theme-card span {
    font-size: 1rem;
    color: #333;
    font-weight: 600;
}

/* 最近阅读 */
.recent-reading {
    margin-bottom: 30px;
}

.recent-reading h2 {
    font-size: 1.3rem;
    color: #333;
    margin-bottom: 15px;
    font-weight: 600;
}

.recent-book {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.recent-cover {
    position: relative;
    margin-right: 15px;
}

.recent-cover img {
    width: 80px;
    height: 110px;
    border-radius: 10px;
    object-fit: cover;
}

.progress-ring {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 30px;
    height: 30px;
}

.progress-circle {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(#FF6B6B 0deg 234deg, #E0E0E0 234deg 360deg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.progress-circle::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
}

.recent-info h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    font-weight: 600;
}

.recent-info p {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 10px;
}

.continue-btn {
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E8E 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.continue-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

/* 底部导航 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #999;
    transition: all 0.3s ease;
    padding: 5px 15px;
}

.nav-item.active {
    color: #FF6B6B;
}

.nav-item i {
    font-size: 1.3rem;
    margin-bottom: 3px;
}

.nav-item span {
    font-size: 0.75rem;
    font-weight: 500;
}

/* 阅读模式 */
.reading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #FFF8E1;
    z-index: 2000;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.reading-controls {
    position: sticky;
    top: 0;
    background: rgba(255, 248, 225, 0.95);
    backdrop-filter: blur(10px);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.close-reading {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #333;
    cursor: pointer;
}

.reading-progress {
    flex: 1;
    margin-left: 15px;
}

.progress-bar {
    height: 4px;
    background: #E0E0E0;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #FF6B6B;
    width: 8.3%;
    transition: width 0.3s ease;
}

.book-content {
    padding: 20px;
    max-width: 400px;
    margin: 0 auto;
}

.story-page {
    background: white;
    border-radius: 20px;
    padding: 30px 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.story-page h1 {
    font-size: 1.8rem;
    color: #333;
    margin-bottom: 20px;
    font-weight: 700;
}

.story-image {
    margin-bottom: 20px;
}

.story-image img {
    width: 100%;
    max-width: 300px;
    height: 200px;
    object-fit: cover;
    border-radius: 15px;
}

.story-text {
    text-align: left;
    margin-bottom: 30px;
}

.story-text p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #555;
    margin-bottom: 15px;
}

.page-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
}

.prev-page, .next-page {
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E8E 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.prev-page:hover, .next-page:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.page-number {
    font-size: 1rem;
    color: #666;
    font-weight: 500;
}

/* 工具类 */
.hidden {
    display: none !important;
}

/* 响应式设计 */
@media (min-width: 768px) {
    .main-content {
        max-width: 600px;
    }
    
    .header-content {
        max-width: 600px;
    }
    
    .category-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
    }
    
    .theme-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .book-scroll {
        gap: 20px;
    }
    
    .book-card {
        width: 160px;
    }
    
    .book-cover {
        height: 180px;
    }
}

@media (min-width: 1024px) {
    .main-content {
        max-width: 800px;
    }
    
    .header-content {
        max-width: 800px;
    }
    
    .book-scroll {
        flex-wrap: wrap;
        overflow-x: visible;
        gap: 20px;
    }
    
    .book-card {
        width: 180px;
        margin-bottom: 20px;
    }
}

/* 动画效果 */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.book-card:hover {
    animation: bounce 0.6s ease;
}

.category-card:hover {
    animation: bounce 0.6s ease;
}

.theme-card:hover {
    animation: bounce 0.6s ease;
}

/* 触摸反馈 */
@media (hover: none) {
    .book-card:active {
        transform: scale(0.95);
    }
    
    .category-card:active {
        transform: scale(0.95);
    }
    
    .theme-card:active {
        transform: scale(0.95);
    }
}