/* ===================== 全局变量 & 基础样式 ===================== */
:root {
    --primary: #667eea;
    --primary-dark: #5568d3;
    --secondary: #764ba2;
    --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-light: #f5f7fa;
    --bg-gray: #e0e5ec;
    --text-dark: #2c3e50;
    --text-muted: #6c757d;
    --card-shadow: 0 10px 40px rgba(0,0,0,0.1);
    --radius: 12px;
    --radius-sm: 8px;
}

body {
    background: linear-gradient(135deg, var(--bg-gray) 0%, var(--bg-light) 100%);
    min-height: 100vh;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ===================== 卡片组件 ===================== */
.card {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    transition: box-shadow 0.3s;
}
.card:hover {
    box-shadow: 0 12px 48px rgba(0,0,0,0.12);
}

/* ===================== 按钮组件 ===================== */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: all 0.25s;
}
.btn:hover {
    transform: translateY(-1px);
}
.btn:active {
    transform: translateY(0);
}
.btn-gradient {
    background: var(--gradient);
    border: none;
    color: white;
}
.btn-gradient:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, #6a3f9a 100%);
    color: white;
}

/* ===================== 表单组件 ===================== */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border: 1px solid #ddd;
    transition: all 0.3s;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102,126,234,0.15);
}

/* ===================== Toast 通知 ===================== */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.toast-custom {
    min-width: 280px;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    color: white;
    font-weight: 500;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    animation: toastIn 0.35s ease-out;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.toast-custom.success { background: linear-gradient(135deg, #28a745, #20c997); }
.toast-custom.danger { background: linear-gradient(135deg, #dc3545, #e74c3c); }
.toast-custom.warning { background: linear-gradient(135deg, #ffc107, #fd7e14); }
.toast-custom.info { background: linear-gradient(135deg, #17a2b8, #0dcaf0); }
.toast-custom .btn-close { filter: brightness(10); }
@keyframes toastIn {
    from { opacity: 0; transform: translateX(100px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100px); }
}

/* ===================== 加载动画 ===================== */
.spinner-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.3);
    z-index: 99999;
    align-items: center;
    justify-content: center;
}
.spinner-overlay.show { display: flex; }
.spinner-custom {
    width: 48px; height: 48px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===================== Lightbox ===================== */
.lightbox-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 99998;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}
.lightbox-overlay.show { display: flex; }
.lightbox-overlay img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.lightbox-overlay .lightbox-close {
    position: absolute;
    top: 20px; right: 30px;
    color: white;
    font-size: 36px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.3s;
}
.lightbox-overlay .lightbox-close:hover { opacity: 1; }
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 40px;
    cursor: pointer;
    padding: 10px 20px;
    opacity: 0.7;
    transition: opacity 0.3s;
}
.lightbox-nav:hover { opacity: 1; }
.lightbox-nav.prev { left: 20px; }
.lightbox-nav.next { right: 20px; }