/* 
 * style.css - 主样式文件
 * 版本: 2.0.0
 */

/* 重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 动画类 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

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

/* 工具类 */
.animate-fade-in {
    animation: fadeInUp 0.8s ease-out;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-float {
    animation: float 3s ease-in-out infinite;
}

.text-shadow {
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.box-shadow-light {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.box-shadow-medium {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.box-shadow-heavy {
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

/* 渐变背景 */
.gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.gradient-success {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
}

.gradient-warning {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
}

.gradient-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

/* 响应式工具 */
@media (max-width: 768px) {
    .mobile-center {
        text-align: center;
    }
    
    .mobile-mt-3 {
        margin-top: 1rem !important;
    }
    
    .mobile-p-3 {
        padding: 1rem !important;
    }
}

@media (min-width: 992px) {
    .desktop-only {
        display: block !important;
    }
    
    .mobile-only {
        display: none !important;
    }
}

/* 卡片增强 */
.card-hover-effect {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-hover-effect:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

/* 按钮增强 */
.btn-gradient {
    background-image: linear-gradient(135deg, var(--primary-color), #2980b9);
    border: none;
    color: white;
    background-size: 200% auto;
    transition: 0.5s;
}

.btn-gradient:hover {
    background-position: right center;
    color: white;
    transform: translateY(-2px);
}

/* 表格样式 */
.table-hover-custom tbody tr {
    transition: all 0.3s ease;
}

.table-hover-custom tbody tr:hover {
    background-color: rgba(52, 152, 219, 0.1);
    transform: scale(1.01);
}

/* 表单样式 */
.form-control-custom {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px 15px;
    transition: all 0.3s ease;
}

.form-control-custom:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(52, 152, 219, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 进度条 */
.progress-custom {
    height: 8px;
    border-radius: 4px;
    background-color: #e0e0e0;
    overflow: hidden;
}

.progress-bar-custom {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* 徽章 */
.badge-custom {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.8rem;
}

.badge-new {
    background: linear-gradient(135deg, var(--accent-color), #c0392b);
    color: white;
}

.badge-popular {
    background: linear-gradient(135deg, var(--warning-color), #e67e22);
    color: white;
}

.badge-updated {
    background: linear-gradient(135deg, var(--secondary-color), #27ae60);
    color: white;
}

/* 图片占位符 */
.img-placeholder {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #7f8c8d;
    font-size: 14px;
}

/* 分页样式 */
.pagination-custom .page-link {
    color: var(--primary-color);
    border: 1px solid #e0e0e0;
    margin: 0 3px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.pagination-custom .page-link:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination-custom .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* 导航标签 */
.nav-tabs-custom {
    border-bottom: 2px solid #e0e0e0;
}

.nav-tabs-custom .nav-link {
    border: none;
    color: #7f8c8d;
    font-weight: 500;
    padding: 10px 20px;
    margin-bottom: -2px;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.nav-tabs-custom .nav-link:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.nav-tabs-custom .nav-link.active {
    color: var(--primary-color);
    background-color: transparent;
    border-bottom: 2px solid var(--primary-color);
}

/* 提示框 */
.alert-custom {
    border: none;
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* 代码块 */
.code-block {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 15px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    overflow-x: auto;
}

/* 工具提示 */
.tooltip-custom {
    position: relative;
    cursor: help;
}

.tooltip-custom::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--dark-color);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.tooltip-custom:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
}

/* 打印样式 */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }
    
    a {
        color: #000;
        text-decoration: none;
    }
}