/* StudyFlow AI - 样式表 */

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

/* 滚动行为优化 */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px; /* 为sticky header留出空间 */
}

/* 基础样式 */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 80vh;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
    pointer-events: none;
    z-index: 1;
}

@media (max-width: 768px) {
    body::before {
        height: 75vh;
    }
    
    html {
        scroll-padding-top: 80px; /* 移动端稍小的偏移 */
    }
}

/* 容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header */
.header {
    background: transparent;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all 0.3s ease;
}

.header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.header.scrolled .logo {
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
}

.header.scrolled .bookmark-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.header.scrolled .bookmark-btn:hover {
    background: linear-gradient(135deg, #5a67d8, #6b46c1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 10;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.bookmark-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.bookmark-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.bookmark-btn svg {
    transition: transform 0.3s ease;
}

.bookmark-btn:hover svg {
    transform: scale(1.1);
}

/* Hero Section */
.hero {
    background: transparent;
    height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    position: relative;
    margin-top: -80px;
    padding-top: 80px;
}

.hero .container {
    position: relative;
    z-index: 10;
    max-width: 800px;
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    margin-bottom: 24px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    animation: fadeInUp 0.8s ease-out;
}

.hero p {
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    opacity: 0.95;
    line-height: 1.6;
    margin-bottom: 32px;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.pain-point {
    font-weight: 400;
    background: rgba(255, 255, 255, 0.9);
    color: #2d3748;
    padding: 1.5rem 2.5rem;
    border-radius: 50px;
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    display: inline-block;
    position: relative;
    padding-left: 4rem;
}

.pain-point::before {
    content: '🎯';
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
}

/* CTA Button */
.cta-button {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 14px 32px;
    border-radius: 50px;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    animation: fadeInUp 0.8s ease-out 0.4s both;
    margin-top: 1rem;
}

.cta-button:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    text-decoration: none;
    color: white;
}

/* 动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Content Section */
.content {
    background: #f8fafc;
    min-height: 100vh;
    padding: 5rem 0 3rem 0; /* 顶部增加padding为header留空间 */
}

.section-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 3rem;
    color: #2d3748;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 3rem;
    color: #718096;
    display: block;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Sort Controls - 已禁用 */
.sort-controls {
    display: none !important;
}

/* 图片等比例显示优化 */
img {
    max-width: 100%;
    height: auto;
}

/* 图片加载失败时的样式 */
.recommender-avatar:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.recommender-avatar[src=""]:after,
.recommender-avatar:not([src]):after {
    opacity: 1;
}

.tool-logo:after {
    content: '🔧';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tool-logo[src=""]:after,
.tool-logo:not([src]):after {
    opacity: 1;
}

/* Recommendations Grid */
.recommendations-grid {
    columns: 2;
    column-gap: 2rem;
    margin-bottom: 3rem;
}

/* Recommendation Cards */
.recommendation-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e2e8f0;
    margin-bottom: 2rem;
    break-inside: avoid;
    width: 100%;
    display: inline-block;
}

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

/* Recommender Info */
.recommender-info {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.recommender-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 1rem;
    object-fit: cover;
    object-position: center;
    background: #f7fafc;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: relative;
}

.recommender-details h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.25rem;
}

.recommender-details p {
    font-size: 0.875rem;
    color: #718096;
}

.platform-badge {
    display: inline-flex;
    align-items: center;
    background: #667eea;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: auto;
}

.platform-logo {
    width: 16px;
    height: 16px;
    margin-right: 0.5rem;
    border-radius: 2px;
    object-fit: contain;
    object-position: center;
    background: rgba(255, 255, 255, 0.2);
    padding: 1px;
}

/* Recommendation Content */
.recommendation-content {
    margin-bottom: 1.5rem;
}

.recommendation-text {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #2d3748;
    margin-bottom: 1.5rem;
    font-weight: 500;
    padding: 0.5rem 0;
}

/* Video Thumbnail */
.video-thumbnail {
    position: relative;
    background-size: cover;
    background-position: center;
    border-radius: 8px;
    margin: 1rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
    aspect-ratio: 16 / 9;
    min-height: 120px;
    width: 100%;
}

.video-play-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FF0000;
    font-size: 1.2rem;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.video-play-icon:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 1);
}

/* Tool Highlight */
.ai-tool-highlight {
    background: #f8fafc;
    color: #4a5568;
    padding: 1.5rem;
    border-radius: 12px;
    margin: 1rem 0 1.5rem 0;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.ai-tool-highlight:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.tool-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
}

.tool-logo {
    width: 32px;
    height: 32px;
    margin-right: 0.75rem;
    border-radius: 6px;
    object-fit: contain;
    object-position: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
}

.tool-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #2d3748;
}

.tool-description {
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.tool-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag {
    background: #667eea;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: 0.875rem;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn svg {
    transition: transform 0.2s ease;
}

.btn:hover svg {
    transform: translate(2px, -2px);
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a67d8;
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
}

/* Engagement Stats */
.engagement-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    margin-bottom: 0;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
    font-size: 0.875rem;
    color: #718096;
}

.stat {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Error State */
.error-state {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin: 2rem auto;
    max-width: 500px;
}

.error-state h3 {
    color: #e53e3e;
    margin-bottom: 1rem;
}

.error-state button {
    background: #667eea;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 1rem;
    transition: background-color 0.3s ease;
}

.error-state button:hover {
    background: #5a67d8;
}

/* Animations */
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .recommendations-grid {
        columns: 1;
    }
}

@media (max-width: 768px) {
    .hero {
        height: 75vh;
        padding: 0;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero p {
        font-size: 1.1rem;
        max-width: 90%;
    }
    
    .pain-point {
        padding: 1rem 1.5rem;
        padding-left: 3rem;
        font-size: 1rem;
        border-radius: 25px;
    }
    
    .pain-point::before {
        left: 1rem;
        font-size: 1rem;
    }
    
    .cta-button {
        padding: 12px 24px;
        font-size: 1rem;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .recommendation-card {
        padding: 1.5rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn {
        margin-bottom: 0.5rem;
    }
    
    /* 排序控件移动端样式已移除 */
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .pain-point {
        padding: 0.75rem 1rem;
        padding-left: 2.5rem;
        font-size: 0.9rem;
    }
    
    .engagement-stats {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .stat {
        font-size: 0.75rem;
    }
} 