/* 故事页面专属样式 */

/* 顶部横幅区域 */
.hero-banner {
    position: relative;
    width: 100%;
    height: 20vh;
    min-height: 200px;
    overflow: hidden;
    margin-top: 60px;
    outline: none;
    cursor: default;
}

.hero-banner:focus-visible {
    outline: 3px solid var(--primary);
    outline-offset: -3px;
}

.hero-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    pointer-events: none;
}

.banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(15, 23, 42, 0.1) 0%,
        rgba(15, 23, 42, 0.5) 40%,
        rgba(15, 23, 42, 0.95) 100%
    );
}

.banner-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    text-align: center;
    animation: fadeInUp 1s ease;
}

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

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.5rem;
    background: rgba(102, 126, 234, 0.2);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 50px;
    font-size: 0.875rem;
    color: var(--primary);
    margin-bottom: 1rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(102, 126, 234, 0); }
}

.banner-content h1 {
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #fff 0%, #a5b4fc 50%, #c4b5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.banner-content p {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* 统计 */
.story-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    padding: 2rem;
    flex-wrap: wrap;
    max-width: 800px;
    margin: 0 auto;
}

.story-stat {
    text-align: center;
}

.story-stat-number {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.story-stat-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* 搜索和筛选 */
.filter-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem 2rem;
}

.search-box {
    position: relative;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.search-box input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50px;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
}

.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.search-box input::placeholder {
    color: var(--text-secondary);
}

.search-box i {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
}

.highlight-toggle {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.toggle-btn {
    padding: 0.6rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toggle-btn:hover {
    border-color: var(--primary);
    color: var(--text-primary);
}

.toggle-btn.active {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: white;
    border-color: transparent;
}

/* 故事列表 */
.stories-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem 4rem;
}

.stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.story-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: block;
    position: relative;
    overflow: hidden;
}

.story-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transform: scaleX(0);
    transition: transform 0.3s;
}

.story-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: rgba(102, 126, 234, 0.3);
}

.story-card:hover::before {
    transform: scaleX(1);
}

.story-card.highlighted {
    border-color: rgba(245, 87, 108, 0.3);
    background: rgba(245, 87, 108, 0.05);
}

.story-card.highlighted::before {
    background: linear-gradient(90deg, var(--accent), var(--accent2));
}

.story-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.story-episode {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(102, 126, 234, 0.2);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
}

.story-card.highlighted .story-episode {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: white;
}

.story-highlight-badge {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #fbbf24;
    font-size: 0.8rem;
    font-weight: 600;
}

.story-card h3 {
    font-size: 1.05rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.story-card p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.story-recommendation {
    color: #cbd5e1 !important;
    font-size: 0.88rem !important;
    line-height: 1.7 !important;
    -webkit-line-clamp: 5 !important;
    border-left: 3px solid rgba(240, 147, 251, 0.5);
    padding-left: 0.75rem;
    font-style: italic;
}

.story-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.story-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.story-tag {
    padding: 0.2rem 0.6rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.story-arrow {
    color: var(--text-secondary);
    transition: all 0.3s;
}

.story-card:hover .story-arrow {
    transform: translateX(5px);
    color: var(--primary);
}

/* 加载和空状态 */
.loading {
    text-align: center;
    padding: 4rem 2rem;
}

.loading i {
    font-size: 2rem;
    color: var(--primary);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* 响应式 */
@media (max-width: 768px) {
    .hero-banner {
        height: 30vh;
        min-height: 180px;
    }

    .banner-content {
        padding: 1.5rem 1rem;
    }

    .banner-content h1 {
        font-size: 1.5rem;
    }

    .banner-content p {
        font-size: 0.85rem;
    }

    .stories-grid {
        grid-template-columns: 1fr;
    }

    .story-stats {
        gap: 1.5rem;
    }
}
