/**
 * EasyLottie - 收藏/Star 样式
 * V1.2.71 - 留存优化
 */

/* ===== 收藏区域 ===== */
.starred-section {
    margin: 40px 0;
    padding: 30px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(251, 191, 36, 0.15);
    border: 2px solid rgba(251, 191, 36, 0.3);
    transition: all 0.3s ease;
}

.starred-section:hover {
    box-shadow: 0 4px 20px rgba(251, 191, 36, 0.25);
}

/* ===== 标题区域 ===== */
.starred-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.starred-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #78350f;
}

.starred-title .icon {
    font-size: 28px;
    animation: starPulse 2s ease-in-out infinite;
}

@keyframes starPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.starred-title .title-text {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.starred-title .count {
    font-size: 18px;
    color: #92400e;
    font-weight: 400;
}

/* ===== 收藏网格 ===== */
.starred-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

/* ===== 收藏卡片 ===== */
.starred-card {
    background: #ffffff;
    border: 2px solid #fbbf24;
    border-radius: 12px;
    padding: 20px;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: hidden;
}

.starred-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.starred-card:hover {
    border-color: #f59e0b;
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.2);
    transform: translateY(-4px);
}

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

/* ===== 取消收藏按钮 ===== */
.unstar-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #fbbf24;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.unstar-btn:hover {
    background: #fef3c7;
    border-color: #f59e0b;
    transform: rotate(72deg) scale(1.2);
}

/* ===== 收藏图标 ===== */
.star-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: 0 auto 16px;
    transition: transform 0.3s ease;
}

.starred-card:hover .star-icon {
    transform: scale(1.1) rotate(-5deg);
}

/* ===== 收藏信息 ===== */
.star-info {
    text-align: center;
    margin-bottom: 16px;
}

.star-name {
    font-size: 15px;
    font-weight: 600;
    color: #2d3436;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.star-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.star-type {
    font-weight: 600;
    padding: 2px 8px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.star-size {
    font-size: 12px;
    color: #95a5a6;
}

.star-time {
    font-size: 12px;
    color: #95a5a6;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.star-time::before {
    content: '⭐';
    font-size: 10px;
}

/* ===== 打开按钮 ===== */
.open-star-btn {
    width: 100%;
    padding: 10px 20px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.open-star-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.open-star-btn:active {
    transform: translateY(0);
}

/* ===== 收藏按钮（工具页使用） ===== */
.star-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: white;
    border: 2px solid #fbbf24;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #f59e0b;
    cursor: pointer;
    transition: all 0.3s ease;
}

.star-button:hover {
    background: #fef3c7;
    border-color: #f59e0b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.star-button.starred {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-color: #d97706;
    color: white;
}

.star-button.starred:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}

.star-button .star-icon {
    font-size: 18px;
    width: auto;
    height: auto;
    margin: 0;
    background: none;
    transition: transform 0.3s ease;
}

.star-button:hover .star-icon {
    transform: rotate(72deg) scale(1.2);
}

/* ===== 查看全部按钮 ===== */
.starred-section .view-all-btn {
    padding: 10px 24px;
    background: transparent;
    border: 2px solid #f59e0b;
    color: #f59e0b;
    border-radius: 25px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.starred-section .view-all-btn:hover {
    background: #f59e0b;
    color: white;
    transform: translateX(4px);
}

/* ===== 空状态 ===== */
.starred-empty {
    text-align: center;
    padding: 60px 20px;
    color: #92400e;
}

.starred-empty .icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.starred-empty p {
    font-size: 16px;
    margin: 0;
}

/* ===== 响应式设计 ===== */

/* 平板 */
@media (max-width: 1024px) {
    .starred-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 16px;
    }
    
    .starred-section {
        padding: 24px;
    }
}

/* 手机 */
@media (max-width: 768px) {
    .starred-section {
        padding: 20px;
        margin: 24px 0;
    }
    
    .starred-title {
        font-size: 20px;
    }
    
    .starred-title .icon {
        font-size: 24px;
    }
    
    .starred-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .starred-card {
        padding: 16px;
    }
    
    .star-icon {
        width: 50px;
        height: 50px;
        font-size: 28px;
        margin-bottom: 12px;
    }
    
    .star-name {
        font-size: 14px;
    }
    
    .star-meta {
        font-size: 12px;
        gap: 8px;
    }
    
    .open-star-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .starred-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .starred-section .view-all-btn {
        align-self: stretch;
        text-align: center;
    }
}

/* 小手机 */
@media (max-width: 480px) {
    .starred-grid {
        grid-template-columns: 1fr;
    }
    
    .starred-card {
        display: flex;
        align-items: center;
        gap: 16px;
        text-align: left;
    }
    
    .star-icon {
        width: 60px;
        height: 60px;
        margin: 0;
        flex-shrink: 0;
    }
    
    .star-info {
        flex: 1;
        text-align: left;
        margin-bottom: 0;
    }
    
    .star-name {
        text-align: left;
    }
    
    .star-meta {
        justify-content: flex-start;
    }
    
    .star-time {
        justify-content: flex-start;
    }
    
    .unstar-btn {
        top: 12px;
        right: 12px;
    }
    
    .open-star-btn {
        min-width: 80px;
    }
}

/* ===== 深色模式支持 ===== */
@media (prefers-color-scheme: dark) {
    .starred-section {
        background: linear-gradient(135deg, #78350f 0%, #92400e 100%);
        border-color: #b45309;
    }
    
    .starred-title {
        color: #fef3c7;
    }
    
    .starred-card {
        background: #1f2937;
        border-color: #d97706;
    }
    
    .star-name {
        color: #dfe6e9;
    }
    
    .star-meta, .star-time, .star-size {
        color: #b2bec3;
    }
    
    .unstar-btn {
        background: rgba(31, 41, 55, 0.9);
        border-color: #d97706;
    }
    
    .unstar-btn:hover {
        background: #78350f;
    }
}

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

.starred-card {
    animation: fadeInUp 0.4s ease-out forwards;
}

.starred-card:nth-child(1) { animation-delay: 0.05s; }
.starred-card:nth-child(2) { animation-delay: 0.1s; }
.starred-card:nth-child(3) { animation-delay: 0.15s; }
.starred-card:nth-child(4) { animation-delay: 0.2s; }
.starred-card:nth-child(5) { animation-delay: 0.25s; }
.starred-card:nth-child(6) { animation-delay: 0.3s; }

/* ===== Toast 动画 ===== */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}
