/* 全局样式重置与基础设置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #4F46E5;
    --secondary: #7C3AED;
    --accent: #EC4899;
    --dark: #111827;
    --light: #F9FAFB;
    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;
    --info: #06B6D4;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background-color: var(--light);
    overflow-x: hidden;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary);
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes scale {
    0% {
        transform: scale(0.9);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* 自定义工具类 */
.fade-in {
    animation: fadeIn 0.8s ease forwards;
}

.pulse {
    animation: pulse 2s infinite;
}

.slide-in-left {
    animation: slideInLeft 0.6s ease forwards;
}

.slide-in-right {
    animation: slideInRight 0.6s ease forwards;
}

.scale {
    animation: scale 0.5s ease forwards;
}

/* 响应式网格系统增强 */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* 卡片组件样式增强 */
.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* 渐变按钮样式 */
.gradient-btn {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 14px 0 rgba(79, 70, 229, 0.39);
}

.gradient-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 14px 0 rgba(79, 70, 229, 0.39);
    background: linear-gradient(135deg, var(--secondary), var(--primary));
}

.gradient-btn:active {
    transform: translateY(0);
}

/* 按钮变体 */
.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

/* 输入框样式增强 */
.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #E5E7EB;
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-input::placeholder {
    color: #9CA3AF;
}

/* 标签样式 */
.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
}

.tag-primary {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
}

.tag-primary:hover {
    background: rgba(79, 70, 229, 0.2);
}

/* 卡片网格布局 */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .card-grid {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 0 1rem;
    }
}

/* 加载状态 */
.loading {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    max-width: 90%;
    width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: var(--transition);
}

.modal.active .modal-content {
    transform: scale(1);
}

/* 暗黑模式样式 */
.dark-mode {
    --dark: #F9FAFB;
    --light: #111827;
    background-color: var(--light);
    color: var(--dark);
}

.dark-mode .card {
    background: #1F2937;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
}

.dark-mode .form-input {
    background: #374151;
    border-color: #4B5563;
    color: var(--dark);
}

.dark-mode .form-input::placeholder {
    color: #9CA3AF;
}

/* 骨架屏样式 */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 120px;
    background-color: var(--dark);
    color: var(--light);
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -60px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.75rem;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* 分割线样式 */
.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #E5E7EB, transparent);
    margin: 2rem 0;
}

/* 徽章样式 */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.badge-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

/* 特色盒子 */
.feature-box {
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 2rem;
    transition: var(--transition);
    background: white;
}

.feature-box:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.feature-box-icon {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    color: white;
}

/* 统计数字动画 */
.counter {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
}

/* 通知样式 */
.notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transform: translateX(100%);
    transition: var(--transition);
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    background: rgba(16, 185, 129, 0.1);
    border-left: 4px solid var(--success);
    color: var(--success);
}

.notification-error {
    background: rgba(239, 68, 68, 0.1);
    border-left: 4px solid var(--error);
    color: var(--error);
}

/* 打印样式 */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .no-print {
        display: none;
    }
    
    .container {
        width: 100%;
        max-width: none;
    }
}