/**
 * ============================================================
 *  融合云管理系统 - 全局样式
 *  Danny Cloud - Global Styles
 * ============================================================
 */

/* ==============================================================
   1. 基础布局
   ============================================================== */
html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

body {
    background-color: #f0f2f5;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

/* ==============================================================
   2. 导航栏样式
   ============================================================== */
.navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, .1);
    padding: 1rem 2rem;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
}

.nav-link {
    font-size: 1.1rem;
    padding: 0.5rem 1rem !important;
}

/* ==============================================================
   3. 下拉菜单
   ============================================================== */
.dropdown-menu {
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
    border: none;
    padding: 8px;
}

.dropdown-item {
    padding: 10px 16px;
    border-radius: 8px;
    transition: all 0.2s ease, transform 0.3s ease;
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background-color: #f0f2f5;
    transform: translateX(5px);
}

/* ==============================================================
   4. 主要内容区域
   ============================================================== */
.main-content .container-fluid {
    flex: 1;
    width: 100%;
    max-width: 100%;
    padding: 2rem;
}

/* ==============================================================
   5. Footer
   ============================================================== */
.footer {
    width: 100%;
    background-color: #1a1a2e;
    color: #fff;
    text-align: center;
    padding: 15px 0;
    position: relative;
    margin-top: auto;
}

/* ==============================================================
   6. Jumbotron (Hero 区域)
   ============================================================== */
.jumbotron {
    background-color: white;
    border-radius: 16px;
    padding: 3rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .06);
    margin-bottom: 2rem;
}

/* ==============================================================
   7. 卡片系统
   ============================================================== */
.card {
    border: none;
    border-radius: 16px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid #e5e7eb;
    padding: 16px 24px;
    font-weight: 600;
}

.card-body {
    padding: 24px;
}

/* Bootstrap 卡片颜色替换 */
.card.bg-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.card.bg-success {
    background: linear-gradient(135deg, #10b981 0%, #047857 100%) !important;
}

.card.bg-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
}

.card.bg-danger {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%) !important;
}

.card.bg-info {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%) !important;
}

.card.bg-dark {
    background: linear-gradient(135deg, #374151 0%, #111827 100%) !important;
}

/* 带光晕特效的卡片 */
.card-glow {
    position: relative;
}

.card-glow::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 10%;
    width: 80%;
    height: 4px;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.6), transparent);
    border-radius: 50%;
    filter: blur(2px);
    animation: glowPulse 2s ease-in-out infinite alternate;
}

@keyframes glowPulse {
    0% { opacity: 0.3; transform: scaleX(0.8); }
    100% { opacity: 1; transform: scaleX(1); }
}

/* ==============================================================
   8. 按钮系统
   ============================================================== */
.btn {
    border-radius: 10px;
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(90deg, #667eea, #764ba2);
    border: none;
    padding: 10px 24px;
    font-size: 16px;
    border-radius: 10px;
}

.btn-primary:hover {
    background: linear-gradient(90deg, #764ba2, #667eea);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-outline-primary {
    border-color: #667eea;
    color: #667eea;
}

.btn-outline-primary:hover {
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-color: transparent;
    color: white;
}

/* ==============================================================
   9. 表单控件
   ============================================================== */
.form-control {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px 14px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.form-select {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px 14px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.form-label {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 6px;
    color: #374151;
}

/* ==============================================================
   10. 表格
   ============================================================== */
.table {
    margin-bottom: 0;
}

.table thead th {
    border-bottom: 2px solid #e5e7eb;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    color: #6b7280;
    padding: 12px 16px;
}

.table tbody td {
    padding: 12px 16px;
    vertical-align: middle;
}

.table tbody tr {
    transition: background 0.2s ease;
}

.table tbody tr:hover {
    background: #f9fafb;
}

/* ==============================================================
   11. 动画
   ============================================================== */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 渐变色背景动画 */
@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 辉光动画 */
.glow-effect {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 10px;
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.8), rgba(118, 75, 162, 0.8));
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.8);
    animation: glow 2s infinite alternate;
}

@keyframes glow {
    0% {
        box-shadow: 0 0 5px rgba(102, 126, 234, 0.8);
    }
    100% {
        box-shadow: 0 0 20px rgba(118, 75, 162, 0.9);
    }
}

/* 波浪动画 */
.wave-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
}

.wave-container svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 40px;
}

.wave-container .shape-fill {
    fill: rgba(102, 126, 234, 0.5);
    animation: waveMove 3s infinite linear;
}

@keyframes waveMove {
    0% {
        transform: translateX(0%);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* 脉冲动画 */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* 抖动动画 */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.shake {
    animation: shake 0.6s ease-in-out;
}

/* 骨架屏闪烁 */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ==============================================================
   12. 工具类
   ============================================================== */

/* 渐变文字 */
.text-gradient {
    background: linear-gradient(90deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 玻璃态 */
.glass {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 浮动 */
.float {
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* 阴影等级 */
.shadow-hover {
    transition: box-shadow 0.3s ease;
}

.shadow-hover:hover {
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
}

/* 圆角工具 */
.rounded-4 { border-radius: 12px; }
.rounded-5 { border-radius: 16px; }
.rounded-6 { border-radius: 20px; }

/* 宽度限制 */
.max-w-sm { max-width: 24rem; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-xl { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-5xl { max-width: 64rem; }
.max-w-6xl { max-width: 72rem; }
.max-w-7xl { max-width: 80rem; }

/* 间距 */
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }
.gap-6 { gap: 24px; }

/* 文本省略 */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==============================================================
   13. 响应式调整
   ============================================================== */
@media (max-width: 768px) {
    .navbar {
        padding: 0.5rem 1rem;
    }

    .main-content .container-fluid {
        padding: 1rem;
    }

    .jumbotron {
        padding: 1.5rem;
    }

    .card-body {
        padding: 16px;
    }

    .content-wrapper {
        padding: 16px !important;
    }

    h2 {
        font-size: 1.25rem;
    }
}

/* ==============================================================
   14. 打印优化
   ============================================================== */
@media print {
    .sidebar, .topbar, .mobile-bottom-nav, .floating-buttons {
        display: none !important;
    }
    
    .main-content {
        margin: 0 !important;
        padding: 0 !important;
    }
}

/* ==============================================================
   15. 暗色模式 (aria 感知)
   ============================================================== */
@media (prefers-color-scheme: dark) {
    body {
        background: #0f1117;
    }
    
    .card {
        background: #1a1b23;
    }
    
    .card-header {
        border-bottom-color: #2d2e3a;
    }
    
    .table {
        color: #e5e7eb;
        --bs-table-bg: transparent;
    }
    
    .table thead th {
        color: #9ca3af;
        border-bottom-color: #2d2e3a;
    }
    
    .table tbody tr:hover {
        background: rgba(255, 255, 255, 0.03);
    }
    
    .form-control,
    .form-select {
        background: #1a1b23;
        border-color: #2d2e3a;
        color: #e5e7eb;
    }
    
    .form-control:focus,
    .form-select:focus {
        background: #1a1b23;
        border-color: #667eea;
        color: #e5e7eb;
    }
    
    .form-label {
        color: #e5e7eb;
    }
    
    .dropdown-menu {
        background: #1a1b23;
        border-color: #2d2e3a;
    }
    
    .dropdown-item {
        color: #e5e7eb;
    }
    
    .dropdown-item:hover {
        background: rgba(255, 255, 255, 0.05);
    }
    
    .list-group-item {
        background: #1a1b23;
        border-color: #2d2e3a;
        color: #e5e7eb;
    }
    
    .modal-content {
        background: #1a1b23;
        color: #e5e7eb;
    }
    
    .modal-header,
    .modal-footer {
        border-color: #2d2e3a;
    }
}
