/* ========================================
   SaaS 现代化布局 - 自定义样式
   配合 Tailwind CSS 使用
   ======================================== */

/* ===== 全局 ===== */
* { box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif; }

/* ===== 侧边栏 ===== */
.sidebar {
    transition: width 0.3s ease;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.sidebar-link {
    transition: all 0.2s ease;
}
.sidebar-link:hover {
    background: rgba(255,255,255,0.08);
}
.sidebar-link.active {
    background: rgba(59, 130, 246, 0.3);
    border-right: 3px solid #3b82f6;
}

.sidebar-group-title {
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgba(148, 163, 184, 0.7);
    padding: 1rem 1rem 0.5rem;
}

/* ===== 内容区过渡 ===== */
.page-enter {
    animation: fadeInUp 0.3s ease;
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== 卡片悬停效果 ===== */
.hover-card {
    transition: all 0.2s ease;
}
.hover-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
}

/* ===== 表格样式 ===== */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
.data-table thead th {
    background: #f8fafc;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}
.data-table tbody td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.875rem;
    color: #334155;
}
.data-table tbody tr:hover {
    background: #f8fafc;
}
.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* ===== 状态徽章 ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-info    { background: #dbeafe; color: #1e40af; }
.badge-gray    { background: #f1f5f9; color: #475569; }

/* ===== 表单元素 ===== */
.form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}
.form-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.form-input.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.375rem;
}

.form-select {
    width: 100%;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    background: white url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e") right 0.5rem center/1.5rem 1.5rem no-repeat;
    appearance: none;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* ===== 按钮 ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    outline: none;
    gap: 0.375rem;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary   { background: #2563eb; color: white; }
.btn-primary:hover:not(:disabled) { background: #1d4ed8; }
.btn-success   { background: #16a34a; color: white; }
.btn-success:hover:not(:disabled) { background: #15803d; }
.btn-danger    { background: #dc2626; color: white; }
.btn-danger:hover:not(:disabled)  { background: #b91c1c; }
.btn-warning   { background: #f59e0b; color: white; }
.btn-warning:hover:not(:disabled) { background: #d97706; }
.btn-outline   { background: white; color: #374151; border: 1px solid #d1d5db; }
.btn-outline:hover:not(:disabled) { background: #f9fafb; }
.btn-ghost     { background: transparent; color: #374151; }
.btn-ghost:hover:not(:disabled)   { background: #f3f4f6; }
.btn-sm        { padding: 0.25rem 0.75rem; font-size: 0.8125rem; }
.btn-lg        { padding: 0.75rem 1.5rem; font-size: 1rem; }

/* ===== 加载状态 ===== */
.loading-spinner {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid rgba(59,130,246,0.3);
    border-radius: 50%;
    border-top-color: #3b82f6;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 分页 ===== */
.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    color: #374151;
    background: white;
    border: 1px solid #d1d5db;
    cursor: pointer;
    transition: all 0.15s;
}
.pagination-btn:hover:not(:disabled):not(.active) {
    background: #f3f4f6;
}
.pagination-btn.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
}
.pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ===== 步骤条 ===== */
.step-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.step-circle {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}
.step-circle.active    { background: #2563eb; color: white; }
.step-circle.completed { background: #16a34a; color: white; }
.step-circle.pending   { background: #e2e8f0; color: #64748b; }

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #94a3b8;
}
.empty-state svg {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    opacity: 0.5;
}

/* ===== 时间线 ===== */
.timeline-item {
    position: relative;
    padding-left: 2rem;
    padding-bottom: 1.5rem;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0.5rem;
    bottom: 0;
    width: 2px;
    background: #e2e8f0;
}
.timeline-item:last-child::before { display: none; }
.timeline-item::after {
    content: '';
    position: absolute;
    left: 0.125rem;
    top: 0.375rem;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    background: #3b82f6;
    border: 2px solid white;
    box-shadow: 0 0 0 2px #3b82f6;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .sidebar { position: fixed; z-index: 50; transform: translateX(-100%); }
    .sidebar.mobile-open { transform: translateX(0); }
}
