/* 主页特有样式 */

/* 页面加载遮罩 */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--theme-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(90, 107, 122, 0.15);
    border-top-color: var(--theme-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* 容器动画 */
.container {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.container.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 卡片容器 */
#cards-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 毛玻璃卡片 */
.card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    box-shadow: 0 8px 32px var(--theme-glass-shadow),
                inset 0 1px 2px rgba(255, 255, 255, 0.5);
    transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1),
                box-shadow 0.3s cubic-bezier(0.2, 0, 0, 1);
    overflow: hidden;
    opacity: 0;
    animation: card-enter 0.4s ease-out forwards;
}

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

/* 卡片内部装饰圆形 */
.card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, 
        rgba(150, 160, 180, 0.1) 0%, 
        transparent 60%
    );
    pointer-events: none;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(100, 100, 120, 0.18),
                inset 0 1px 2px rgba(255, 255, 255, 0.5);
}

.card-left {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
    cursor: pointer;
    position: relative;
    z-index: 2;
    text-decoration: none;
    color: inherit;
}

.card-image-link {
    display: block;
    margin-left: 20px;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(90, 107, 122, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-sm);
    flex-shrink: 0;
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.card:hover .card-icon {
    transform: scale(1.05);
    background: rgba(90, 107, 122, 0.12);
}

.card-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    opacity: 0.75;
}

.card-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 4px;
}

.card-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--md-on-surface);
    letter-spacing: -0.01em;
}

.card-description {
    font-size: 0.9rem;
    color: var(--md-on-surface-variant);
    line-height: 1.4;
}

.card-image {
    width: 120px;
    height: 90px;
    object-fit: cover;
    border-radius: var(--radius-md);
    margin-left: 20px;
    border: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1);
    cursor: pointer;
}

.card:hover .card-image {
    transform: scale(1.03);
}

/* Material You 按钮 */
.card-button {
    position: relative;
    overflow: hidden;
    background: rgba(90, 107, 122, 0.85);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
    box-shadow: 0 2px 8px rgba(90, 107, 122, 0.3);
    letter-spacing: 0.02em;
    margin-top: 12px;
    flex-shrink: 0;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-end;
}

.card-button:hover {
    box-shadow: 0 4px 16px rgba(90, 107, 122, 0.4);
    transform: scale(1.02);
    background: rgba(90, 107, 122, 0.95);
}

.card-button:active {
    transform: scale(0.98);
}

/* 涟漪效果 */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: ripple-effect 0.6s cubic-bezier(0.2, 0, 0, 1);
    pointer-events: none;
}

@keyframes ripple-effect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* 可点击元素的涟漪容器 */
.clickable {
    position: relative;
    overflow: hidden;
}

/* 响应式 */
@media (max-width: 600px) {
    #cards-container {
        gap: 14px;
    }
    
    .card {
        padding: 16px;
    }
    
    .card-left {
        gap: 12px;
    }
    
    .card-icon {
        width: 40px;
        height: 40px;
    }
    
    .card-title {
        font-size: 1.05rem;
    }
    
    .card-description {
        font-size: 0.85rem;
    }
    
    .card-button {
        width: 100%;
        margin-top: 12px;
        padding: 12px 20px;
    }
}

/* 减少动画 */
@media (prefers-reduced-motion: reduce) {
    .card {
        animation: none;
    }
    
    .card:hover {
        transform: none;
    }
}
