/**
 * 公共组件样式
 */

/* 加载状态 */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.loading-spinner {
    position: relative;
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
}

.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid rgba(255, 215, 0, 0.2);
    border-top-color: #FFD700;
    border-radius: 50%;
    animation: spin 1.2s linear infinite;
}

.spinner-ring.delay-1 {
    animation-delay: -0.4s;
}

.spinner-ring.delay-2 {
    animation-delay: -0.8s;
}

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

.loading-text {
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

/* 空状态 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-icon {
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-title {
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
}

.empty-desc {
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    margin-bottom: 24px;
}

.empty-btn {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #1a1c2e;
    border: none;
    border-radius: 25px;
    padding: 12px 32px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.empty-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

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

/* Toast提示 */
.toast-container {
    position: fixed;
    top: calc(56px + env(safe-area-inset-top) + 20px);
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: #fff;
    padding: 14px 24px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 80%;
    text-align: center;
}

.toast-container.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-message {
    font-size: 14px;
    font-weight: 500;
}

/* 触摸反馈 */
button, a, .btn, .clickable {
    transition: transform 0.15s ease, opacity 0.15s ease;
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

button:active, a:active, .btn:active, .clickable:active {
    transform: scale(0.95);
    opacity: 0.85;
}

/* 安全区域适配 */
.safe-area-top {
    padding-top: env(safe-area-inset-top);
}

.safe-area-bottom {
    padding-bottom: env(safe-area-inset-bottom);
}

.safe-area-left {
    padding-left: env(safe-area-inset-left);
}

.safe-area-right {
    padding-right: env(safe-area-inset-right);
}

.safe-area-all {
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
