/* 统一加载和骨架屏样式 */

/* 1. 骨架屏基础样式 */
.skeleton {
    background: linear-gradient(90deg, 
        var(--card-background) 25%, 
        var(--border-color) 50%, 
        var(--card-background) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.2s ease-in-out infinite;
    border-radius: 16px; /* 大卡片圆角 */ /* 卡片圆角 */ /* 按钮圆角 */ /* 小元素圆角 */
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 骨架屏卡片 */
.skeleton-card {
    background: var(--card-background);
    padding: 16px;
    margin-bottom: 12px;
    border-radius: 16px; /* 大卡片圆角 */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.skeleton-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 16px; /* 大卡片圆角 */ /* 卡片圆角 */
}

.skeleton-title {
    flex: 1;
    height: 20px;
    border-radius: 16px; /* 大卡片圆角 */ /* 卡片圆角 */ /* 按钮圆角 */ /* 小元素圆角 */
}

.skeleton-text {
    height: 14px;
    margin-top: 8px;
    border-radius: 16px; /* 大卡片圆角 */ /* 卡片圆角 */ /* 按钮圆角 */ /* 小元素圆角 */
}

.skeleton-numbers {
    display: flex;
    gap: 8px;
    margin: 16px 0;
    justify-content: center;
}

.skeleton-ball {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.skeleton-button {
    flex: 1;
    height: 36px;
    border-radius: 16px; /* 大卡片圆角 */ /* 卡片圆角 */
}

/* 2. 统一加载动画 - 旋转圈 */
.loading-spinner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}



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

/* 大号加载圈 */
.spinner-large {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

/* 小号加载圈 */
.spinner-small {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

/* 3. 页面级加载遮罩 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.loading-overlay .spinner {
    width: 48px;
    height: 48px;
    border-width: 5px;
    border-color: rgba(255, 255, 255, 0.2);
    border-top-color: #ffffff;
}

/* 4. 加载文字提示 */
.loading-text {
    margin-top: 12px;
    color: var(--text-secondary);
    font-size: 14px;
    text-align: center;
}

/* 5. 内联加载状态 */
.loading-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.loading-inline .spinner {
    margin-right: 8px;
}

/* 6. 点击反馈效果 */
.touchable {
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.2s ease;
}

.touchable:active {
    transform: scale(0.95);
    opacity: 0.7;
}

/* 按钮点击反馈 */
.btn-feedback:active {
    transform: scale(0.95);
}

/* 卡片点击反馈 */
.card-feedback:active {
    transform: translateY(2px);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

/* 波纹效果容器 */
.ripple-container {
    position: relative;
    overflow: hidden;
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: scale(0);
    animation: ripple-animation 0.6s ease-out;
    pointer-events: none;
}

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

/* 暗色主题波纹 */
:root[data-theme="dark"] .ripple {
    background: rgba(255, 255, 255, 0.3);
}

/* 7. 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 48px;
    opacity: 0.5;
    margin-bottom: 16px;
}

.empty-state-text {
    font-size: 14px;
    line-height: 1.6;
}

/* 8. 错误状态 */
.error-state {
    text-align: center;
    padding: 40px 20px;
    color: #ff3b30;
}

.error-state-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.error-state-text {
    font-size: 14px;
    margin-bottom: 16px;
}

.retry-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--primary-color);
    color: #ffffff;
    border: none;
    border-radius: 16px; /* 大卡片圆角 */ /* 卡片圆角 */ /* 按钮圆角 */
    font-size: 14px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.retry-button:active {
    opacity: 0.8;
}

/* 9. 返回顶部按钮 */
.back-to-top {
    position: fixed;
    right: 20px;
    bottom: 80px;
    width: 48px;
    height: 48px;
    background: var(--primary-color);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:active {
    transform: scale(0.9);
}

.back-to-top i {
    font-size: 20px;
}

/* 暗色主题 */
:root[data-theme="dark"] .back-to-top {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* 10. 重置筛选按钮 */
.filter-reset {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 16px; /* 大卡片圆角 */ /* 卡片圆角 */ /* 按钮圆角 */
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
}

.filter-reset:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.filter-reset:active {
    transform: scale(0.95);
}

.filter-reset i {
    font-size: 12px;
}

/* 11. 点击反馈增强 */
.filter-btn, .lottery-card, .history-item {
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.filter-btn:active {
    transform: scale(0.92);
    opacity: 0.7;
}

/* 12. 移动端优化 - 返回顶部按钮 */
@media screen and (max-width: 480px) {
    .back-to-top {
        right: 15px;
        bottom: 70px;
        width: 44px;
        height: 44px;
    }
    
    .back-to-top i {
        font-size: 18px;
    }
}

