/* 移动端UI增强样式 - 骨架屏、下拉刷新、微交互 */

/* ==================== 骨架屏加载动画 ==================== */
.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 0%,
        #f8f8f8 20%,
        #f0f0f0 40%,
        #f0f0f0 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 骨架屏卡片 */
.skeleton-card {
    background: white;
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing);
    box-shadow: var(--shadow-sm);
}

.skeleton-title {
    height: 20px;
    width: 70%;
    margin-bottom: var(--spacing);
}

.skeleton-text {
    height: 14px;
    width: 100%;
    margin-bottom: var(--spacing-sm);
}

.skeleton-text:last-child {
    width: 60%;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
}

.skeleton-button {
    height: 48px;
    width: 100%;
    border-radius: var(--radius-md);
}

/* ==================== 下拉刷新 ==================== */
.pull-refresh-container {
    position: relative;
    overflow: hidden;
}

.pull-refresh-indicator {
    position: absolute;
    top: -60px;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.pull-refresh-indicator.pulling {
    transform: translateY(60px);
}

.pull-refresh-indicator.refreshing {
    transform: translateY(60px);
}

.pull-refresh-icon {
    width: 32px;
    height: 32px;
    border: 3px solid var(--divider-color);
    border-top-color: var(--primary-color);
    border-radius: var(--radius-full);
    animation: spin 0.8s linear infinite;
}

.pull-refresh-text {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-left: var(--spacing);
}

/* ==================== 微交互动画 ==================== */

/* 点赞/收藏心跳动画 */
@keyframes heartBeat {
    0%, 100% { transform: scale(1); }
    10%, 30% { transform: scale(0.9); }
    20%, 40% { transform: scale(1.1); }
}

.heart-beat {
    animation: heartBeat 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 成功勾选动画 */
@keyframes checkmark {
    0% {
        stroke-dashoffset: 100;
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        stroke-dashoffset: 0;
        opacity: 1;
    }
}

.checkmark-icon {
    stroke-dasharray: 100;
    animation: checkmark 0.6s ease-in-out;
}

/* 抖动提示动画 */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.shake {
    animation: shake 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 弹跳动画 */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.bounce {
    animation: bounce 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 旋转加载 */
@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.rotate {
    animation: rotate 1s linear infinite;
}

/* ==================== 进度条 ==================== */
.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--divider-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-sm);
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ==================== 徽章和标签 ==================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px var(--spacing);
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.badge-primary {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(102, 126, 234, 0.1) 100%);
    color: var(--primary-color);
}

.badge-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.1) 100%);
    color: var(--success-color);
}

.badge-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(245, 158, 11, 0.1) 100%);
    color: var(--warning-color);
}

.badge-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(239, 68, 68, 0.1) 100%);
    color: var(--danger-color);
}

/* ==================== 浮动操作按钮 (FAB) ==================== */
.fab {
    position: fixed;
    bottom: calc(80px + env(safe-area-inset-bottom));
    right: var(--spacing-lg);
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    border: none;
}

.fab:active {
    transform: scale(0.9);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.5);
}

.fab::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    opacity: 0;
    animation: fabPulse 2s ease-in-out infinite;
}

@keyframes fabPulse {
    0%, 100% {
        opacity: 0;
        transform: scale(1);
    }
    50% {
        opacity: 0.3;
        transform: scale(1.2);
    }
}

/* ==================== 图片懒加载占位 ==================== */
.image-placeholder {
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-size: 32px;
    position: relative;
    overflow: hidden;
}

.image-placeholder::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.5),
        transparent
    );
    animation: shimmer 1.5s infinite;
}

/* ==================== 通知横幅 ==================== */
.notification-banner {
    position: fixed;
    top: calc(60px + env(safe-area-inset-top));
    left: var(--spacing-md);
    right: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    background: white;
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    gap: var(--spacing);
    z-index: 1000;
    animation: slideInDown 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-left: 4px solid var(--primary-color);
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(102, 126, 234, 0.1) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 18px;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.notification-message {
    font-size: 13px;
    color: var(--text-secondary);
}

.notification-close {
    color: var(--text-tertiary);
    cursor: pointer;
    padding: var(--spacing-sm);
    border-radius: var(--radius-full);
    transition: all 0.3s;
}

.notification-close:active {
    background: var(--divider-color);
    color: var(--text-primary);
}

/* ==================== 底部抽屉 ==================== */
.bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.12);
    z-index: 2000;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.bottom-sheet.active {
    transform: translateY(0);
}

.bottom-sheet-handle {
    width: 40px;
    height: 4px;
    background: var(--divider-color);
    border-radius: var(--radius-sm);
    margin: var(--spacing) auto;
}

.bottom-sheet-header {
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--divider-color);
}

.bottom-sheet-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
}

.bottom-sheet-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--spacing-lg);
}

/* ==================== 步骤指示器 ==================== */
.stepper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-lg);
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
}

.step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 16px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: var(--divider-color);
    z-index: -1;
}

.step.active:not(:last-child)::after {
    background: var(--primary-color);
}

.step-circle {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--divider-color);
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    transition: all 0.3s;
}

.step.active .step-circle {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transform: scale(1.1);
}

.step.completed .step-circle {
    background: var(--success-color);
    color: white;
}

.step-label {
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 600;
    text-align: center;
}

.step.active .step-label {
    color: var(--primary-color);
    font-weight: 700;
}

/* ==================== 评分星星 ==================== */
.rating {
    display: flex;
    gap: var(--spacing-xs);
}

.rating-star {
    font-size: 20px;
    color: var(--divider-color);
    cursor: pointer;
    transition: all 0.3s;
}

.rating-star.active {
    color: #fbbf24;
    transform: scale(1.1);
}

.rating-star:active {
    transform: scale(0.9);
}

/* ==================== 时间轴 ==================== */
.timeline {
    position: relative;
    padding-left: var(--spacing-xl);
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--divider-color);
}

.timeline-item {
    position: relative;
    padding-bottom: var(--spacing-xl);
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -28px;
    top: 4px;
    width: 16px;
    height: 16px;
    border-radius: var(--radius-full);
    background: white;
    border: 3px solid var(--primary-color);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.timeline-content {
    background: white;
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.timeline-time {
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.timeline-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.timeline-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ==================== 性能优化 ==================== */

/* GPU 加速 */
.gpu-accelerated {
    transform: translateZ(0);
    will-change: transform;
}

/* 减少重绘 */
.no-select {
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

/* 平滑滚动 */
.smooth-scroll {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* 防止文本闪烁 */
.antialiased {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
