/* Catalog - 自定义样式 */

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 选择文本颜色 */
::selection {
    background-color: #3b82f6;
    color: white;
}

::-moz-selection {
    background-color: #3b82f6;
    color: white;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

.slide-in {
    animation: slideIn 0.6s ease-out forwards;
}

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

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

/* 按钮样式增强 */
button, a.button {
    position: relative;
    overflow: hidden;
}

button::before, a.button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:active::before, a.button:active::before {
    width: 300px;
    height: 300px;
}

/* 表单输入框焦点效果 */
input:focus, textarea:focus, select:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

/* 响应式图片 */
img {
    max-width: 100%;
    height: auto;
}

/* 工具提示样式 */
[title] {
    position: relative;
}

/* PDF查看器特定样式 */
#pdf-container {
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.1);
}

#pdf-canvas {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    margin: 20px auto;
}

/* 控制按钮样式 */
.control-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    color: #4b5563;
    border-radius: 8px;
    padding: 8px;
    transition: all 0.2s;
}

.control-btn:hover:not(:disabled) {
    background: #f3f4f6;
    color: #1f2937;
}

.control-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* 版本标签样式 */
.version-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

/* 文本截断 */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

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

/* 移动端优化 */
@media (max-width: 768px) {
    /* 减小标题大小 */
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    /* 调整间距 */
    .py-8 {
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
    }
    
    /* 卡片在移动端不悬浮 */
    .card-hover:hover {
        transform: none;
    }
    
    /* PDF控制栏垂直布局 */
    .pdf-controls > div {
        flex-wrap: wrap;
        justify-content: center;
    }
}

/* 打印样式 */
@media print {
    nav, footer, .pdf-controls {
        display: none;
    }
    
    #pdf-container {
        background: white;
        box-shadow: none;
    }
}

/* 暗色主题支持（预留） */
@media (prefers-color-scheme: dark) {
    /* 未来可以添加暗色主题样式 */
}

/* 无障碍增强 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* 焦点可见性 */
*:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* 过渡动画优化 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

