/* 全局样式 */
:root {
    --primary: #6366f1;
    --secondary: #8b5cf6;
    --accent: #f59e0b;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* 导航链接 */
.nav-link {
    position: relative;
    transition: color 0.3s;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* 卡片悬浮效果 */
.card-hover {
    transition: all 0.3s ease;
}

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

/* 渐变背景 */
.gradient-bg {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

/* 分类标签 */
.category-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.category-tag:hover {
    transform: scale(1.05);
}

.category-tag.active {
    background: var(--primary);
    color: white;
}

/* 书籍卡片 */
.book-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s;
}

.book-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.12);
}

.book-cover {
    aspect-ratio: 3/4;
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 评论卡片 */
.comment-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.3s;
}

.comment-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* Tab 切换 */
.tab-btn {
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.3s;
}

.tab-btn.active {
    background: var(--primary);
    color: white;
}

/* 按钮样式 */
.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 12px 32px;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
}

.btn-outline {
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: 10px 30px;
    border-radius: 12px;
    font-weight: 500;
    transition: all 0.3s;
}

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

/* 输入框 */
.input-field {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* 加载动画 */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 渐变文字 */
.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 标签样式 */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-purple {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.badge-orange {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.badge-green {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

/* 用户菜单 */
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    cursor: pointer;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    min-width: 200px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #4b5563;
    transition: background 0.3s;
}

.user-dropdown a:hover {
    background: #f3f4f6;
}

.user-dropdown a i {
    width: 20px;
    margin-right: 12px;
    color: var(--primary);
}

/* 艺术分类卡片 */
.art-card {
    position: relative;
    height: 200px;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s;
}

.art-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.7) 100%);
}

.art-card:hover {
    transform: scale(1.02);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
}

.art-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    color: white;
}

/* 响应式 */
@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    
    .book-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
