/* 现代化UI优化样式 */

/* 全局变量 */
:root {
    --primary-color: #dc3545;
    --primary-hover: #b02a37;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --info-color: #0dcaf0;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --border-radius: 12px;
    --border-radius-lg: 18px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --gradient-primary: linear-gradient(135deg, #dc3545 0%, #b02a37 100%);
    --gradient-light: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

/* 全局样式优化 */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #2c3e50;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 导航栏优化 */
.navbar {
    background: var(--gradient-primary);
    box-shadow: 0 2px 20px rgba(220, 53, 69, 0.3);
    padding: 1rem 0;
    backdrop-filter: blur(10px);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: white !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand i {
    font-size: 1.8rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    padding: 0.75rem 1rem !important;
    border-radius: var(--border-radius);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.nav-link:hover,
.nav-link:focus {
    color: white !important;
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.nav-link:hover::before {
    left: 100%;
}

/* 英雄区块优化 */
.hero-section {
    background: var(--gradient-primary);
    color: white;
    padding: 4rem 0;
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.hero-section .container {
    position: relative;
    z-index: 1;
}

.hero-section h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    background: linear-gradient(45deg, #ffffff, #f8f9fa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-section p {
    font-size: 1.3rem;
    font-weight: 300;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
}

/* 卡片组件优化 */
.installer-card,
.user-card {
    background: var(--gradient-light);
    border-radius: var(--border-radius-lg);
    border: none;
    box-shadow: var(--shadow);
    transition: var(--transition);
    overflow: hidden;
    position: relative;
    height: 100%;
}

.installer-card::before,
.user-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: var(--transition);
}

.installer-card:hover,
.user-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.installer-card:hover::before,
.user-card:hover::before {
    opacity: 1;
}

.installer-card .card-body,
.user-card .card-body {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.installer-card .card-title,
.user-card .card-title {
    color: var(--dark-color);
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.installer-card .card-text,
.user-card .card-text {
    color: var(--secondary-color);
    line-height: 1.8;
    flex-grow: 1;
    margin-bottom: 1.5rem;
}

/* 按钮优化 */
.btn {
    border-radius: var(--border-radius);
    font-weight: 600;
    padding: 0.875rem 1.5rem;
    border: none;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.875rem;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--gradient-primary);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #b02a37 0%, #8b1e2b 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* 表单优化 */
.form-control,
.form-select {
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    padding: 0.875rem 1rem;
    font-size: 1rem;
    transition: var(--transition);
    background: white;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.15);
    background: white;
}

.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.75rem;
}

/* 区块容器优化 */
.update-section,
.filter-section {
    background: var(--gradient-light);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 模态框优化 */
.modal-content {
    border-radius: var(--border-radius-lg);
    border: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

.modal-header {
    background: var(--gradient-primary);
    color: white;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    padding: 1.5rem 2rem;
    border-bottom: none;
}

.modal-title {
    font-weight: 700;
    font-size: 1.25rem;
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid #dee2e6;
}

/* 徽章优化 */
.badge {
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 表格优化 */
.table {
    background: white;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table thead th {
    background: var(--gradient-primary);
    color: white;
    font-weight: 600;
    border: none;
    padding: 1rem;
}

.table tbody td {
    padding: 1rem;
    border-color: #f1f3f4;
    vertical-align: middle;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.pulse-animation {
    animation: pulse 2s infinite;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 0;
        margin-bottom: 2rem;
    }
    
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .hero-section p {
        font-size: 1.1rem;
    }
    
    .update-section,
    .filter-section {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .installer-card .card-body,
    .user-card .card-body {
        padding: 1.5rem;
    }
    
    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.8rem;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .navbar-brand {
        font-size: 1.25rem;
    }
}

@media (max-width: 576px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .installer-card .card-body,
    .user-card .card-body {
        padding: 1rem;
    }
}

/* 加载状态 */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 成功/错误消息样式 */
.alert {
    border-radius: var(--border-radius);
    border: none;
    font-weight: 500;
    padding: 1rem 1.5rem;
}

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
} 