@tailwind base;
@tailwind components;
@tailwind utilities;

/* 自定义Tailwind配置 */
@layer utilities {
    .content-auto {
        content-visibility: auto;
    }
    .transition-bg-color {
        transition-property: background-color;
        transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
        transition-duration: 150ms;
    }
    .transition-transform {
        transition-property: transform;
        transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
        transition-duration: 150ms;
    }
    .hover-scale {
        @apply hover:scale-105 transition-transform duration-200;
    }
    .btn-primary {
        @apply bg-blue-500 hover:bg-blue-600 text-white px-4 py-2 rounded-md transition-colors duration-200;
    }
    .btn-secondary {
        @apply bg-gray-500 hover:bg-gray-600 text-white px-4 py-2 rounded-md transition-colors duration-200;
    }
    .card {
        @apply bg-white rounded-lg shadow-md p-6 hover:shadow-lg transition-shadow duration-200;
    }
    .input-field {
        @apply border border-gray-300 rounded-md px-4 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent;
    }
}

/* 全局样式 */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

/* 自定义动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

.spin {
    animation: spin 1s linear infinite;
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 视频和音频播放器样式 */
video, audio {
    outline: none;
}

/* 响应式调整 */
@media (max-width: 640px) {
    .max-w-7xl {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .grid-cols-1 md:grid-cols-3 {
        grid-template-columns: 1fr;
    }
}

/* 加载动画 */
.loader {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

/* 按钮加载状态 */
.btn-loading {
    position: relative;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: spin 0.8s linear infinite;
}

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

.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: #555;
    color: #fff;
    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: 12px;
}

.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #555 transparent transparent transparent;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

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

.tag-blue {
    background-color: #dbeafe;
    color: #2563eb;
}

.tag-green {
    background-color: #dcfce7;
    color: #16a34a;
}

.tag-red {
    background-color: #fee2e2;
    color: #dc2626;
}

/* 图集样式 */
.image-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: transform 0.2s ease-in-out;
}

.image-item:hover {
    transform: translateY(-4px);
}

.image-item img {
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s ease-in-out;
}

.image-item img:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.image-item button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}