/**
 * 组件样式
 */

/* Toast */
.toast-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    pointer-events: none;
}

.toast {
    min-width: 160px;
    max-width: 280px;
    padding: 12px 20px;
    background: rgba(0,0,0,0.75);
    color: white;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    animation: toastIn 0.3s ease;
}

.toast.hide { animation: toastOut 0.3s ease forwards; }

@keyframes toastIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes toastOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.toast.success { background: #52C41A; }
.toast.error { background: #FF4D4F; }
.toast.warning { background: #FAAD14; color: #333; }

/* 弹窗 */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.modal-overlay.hide { display: none; }

.modal-content {
    width: 100%;
    max-height: 80vh;
    background: white;
    border-radius: 16px 16px 0 0;
    padding: 20px;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

.modal-close svg { width: 24px; height: 24px; fill: currentColor; }

/* 表单 */
.form-section { margin-bottom: 20px; }
.section-title { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.form-item { margin-bottom: 16px; }
.form-label { display: block; font-size: 14px; color: var(--text-secondary); margin-bottom: 8px; }
.form-label .required { color: var(--error); }
.form-actions { margin-top: 24px; }

/* 案件卡片 */
.case-card {
    display: block;
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}

.case-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.case-no { font-size: 12px; color: var(--text-tertiary); }

.case-card-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.case-debtor {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.case-amount { text-align: right; }
.amount-num { font-size: 18px; font-weight: 600; color: var(--primary); }
.amount-label { display: block; font-size: 12px; color: var(--text-tertiary); }

.case-card-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--text-tertiary);
}

/* 状态 */
.status-tag {
    display: inline-block;
    padding: 2px 8px;
    font-size: 12px;
    border-radius: 4px;
}
.status-0 { background: #FFF7E6; color: #FAAD14; }
.status-1 { background: #E6F7FF; color: #1890FF; }
.status-2 { background: #F9F0FF; color: #722ED1; }
.status-3 { background: #F6FFED; color: #52C41A; }

/* 佣金 */
.commission-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: white;
    border-radius: 8px;
    margin-bottom: 8px;
}

.item-info { display: flex; flex-direction: column; gap: 4px; }
.item-title { font-weight: 500; }
.item-time { font-size: 12px; color: var(--text-tertiary); }
.item-amount { font-weight: 600; }
.item-amount.positive { color: var(--success); }

/* 加载 */
.loading, .list-loading {
    text-align: center;
    padding: 40px;
    color: var(--text-tertiary);
}

/* 骨架屏 */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-header {
    height: 56px;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    padding: 0 16px;
    margin-bottom: 16px;
}

.skeleton-title {
    width: 120px;
    height: 20px;
}

.skeleton-card {
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin: 0 16px 12px;
}

.skeleton-line {
    height: 14px;
    margin-bottom: 12px;
}

.skeleton-line.short { width: 60%; }
.skeleton-line.medium { width: 80%; }
.skeleton-line.long { width: 100%; }

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.skeleton-button {
    height: 48px;
    border-radius: 24px;
    margin: 16px;
}

.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 0 16px;
}

.skeleton-grid-item {
    height: 80px;
    border-radius: 12px;
}

.skeleton-banner {
    height: 120px;
    border-radius: 12px;
    margin: 0 16px 16px;
}

/* 页面加载过渡 */
.page-transition {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
