/**
 * 默认主题样式 - 美化版
 */

/* 全局样式 */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.16);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: #2d3748;
    line-height: 1.7;
    background: #f7fafc;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--secondary-color);
    transform: translateY(-1px);
}

/* 导航栏 */
.navbar {
    background: var(--gradient-primary) !important;
    box-shadow: var(--shadow-md);
    padding: 1rem 0;
    transition: all 0.3s ease;
    z-index: 1050 !important;
}

/* 确保下拉菜单在最上层 */
.navbar .dropdown-menu {
    z-index: 1100 !important;
    position: absolute !important;
}

.navbar .dropdown {
    position: relative;
    z-index: 1051 !important;
}

.navbar .nav-item.dropdown {
    position: relative;
    z-index: 1052 !important;
}

/* 确保用户下拉菜单正确显示 */
.navbar .dropdown-menu-end {
    right: 0;
    left: auto;
}

.navbar-collapse {
    z-index: 1050 !important;
}

.navbar.scrolled {
    padding: 0.5rem 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.75rem;
    color: white !important;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand img {
    max-height: 40px;
}

.navbar-brand i {
    font-size: 1.5rem;
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255,255,255,0.9) !important;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.navbar-dark .navbar-nav .nav-link:hover {
    color: white !important;
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

.navbar-dark .navbar-nav .nav-link.active {
    background: rgba(255,255,255,0.2);
}

/* 幻灯片 */
.carousel-item-content {
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
    border-radius: 16px;
    overflow: hidden;
}

.carousel-caption {
    max-width: 700px;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.5);
}

.carousel-caption h2 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.6s ease;
}

.carousel-caption p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    animation: fadeInUp 0.6s ease 0.2s backwards;
}

.carousel-caption .btn {
    animation: fadeInUp 0.6s ease 0.4s backwards;
}

.carousel-control-prev,
.carousel-control-next {
    width: 5%;
}

.carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin: 0 4px;
}

/* 卡片 */
.card {
    border: none;
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    overflow: hidden;
    background: white;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    background: linear-gradient(135deg, #f6f8fb 0%, #ffffff 100%);
    border-bottom: 2px solid #e2e8f0;
    font-weight: 600;
    padding: 1.25rem 1.5rem;
    font-size: 1.1rem;
}

.card-header i {
    margin-right: 0.5rem;
}

.card-body {
    padding: 1.5rem;
}

/* 文章列表 */
.article-item {
    padding: 1.5rem 0;
    border-bottom: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.article-item:last-child {
    border-bottom: none;
}

.article-item:hover {
    background: linear-gradient(90deg, #f7fafc 0%, transparent 100%);
    padding-left: 1rem;
    margin-left: -1rem;
    margin-right: -1rem;
    padding-right: 1rem;
    border-radius: 12px;
}

.article-item img {
    border-radius: 12px;
    transition: transform 0.3s ease;
}

.article-item:hover img {
    transform: scale(1.05);
}

.article-item h5 a {
    color: #2d3748;
    font-weight: 600;
    font-size: 1.25rem;
}

.article-item h5 a:hover {
    color: var(--primary-color);
}

.article-item .badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
}

/* 文章内容 */
.article-content {
    font-size: 1.1rem;
    line-height: 1.9;
    color: #4a5568;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 2rem 0;
    box-shadow: var(--shadow-md);
}

.article-content p {
    margin-bottom: 1.75rem;
}

.article-content h2,
.article-content h3,
.article-content h4 {
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    color: #2d3748;
    font-weight: 700;
}

.article-content pre {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 12px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.article-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding: 1.25rem 1.5rem;
    margin: 2rem 0;
    background: linear-gradient(90deg, #f7fafc 0%, transparent 100%);
    border-radius: 0 12px 12px 0;
    font-style: italic;
    color: #4a5568;
}

/* 评论 */
.comment-item {
    padding: 1.5rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.comment-item img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #e2e8f0;
}

/* 评分星星 */
.score-star {
    color: #cbd5e0;
    font-size: 1.5rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.score-star:hover,
.score-star.active {
    color: #ffc107;
    transform: scale(1.2);
}

/* 收藏按钮 */
.favorite-btn {
    border-radius: 25px;
    padding: 0.5rem 1.25rem;
    transition: all 0.3s ease;
}

.favorite-btn.active {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
}

/* 分页 */
.pagination .page-link {
    color: var(--primary-color);
    border: none;
    border-radius: 10px;
    margin: 0 3px;
    padding: 0.75rem 1.25rem;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
}

.pagination .page-item.active .page-link {
    background: var(--gradient-primary);
    border-color: transparent;
}

.pagination .page-link:hover {
    background: #e2e8f0;
    transform: translateY(-2px);
}

/* 标签云 */
.badge {
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.badge-light {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    color: #4a5568;
    border: 1px solid #e2e8f0;
}

.badge-light:hover {
    background: var(--gradient-primary);
    color: white !important;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* 页脚 */
footer {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    color: #a0aec0;
    margin-top: 4rem;
    padding: 4rem 0 2rem;
}

footer h5 {
    color: white;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

footer a {
    color: #a0aec0;
    transition: all 0.3s ease;
}

footer a:hover {
    color: white;
    padding-left: 5px;
}

footer hr {
    border-color: #4a5568;
}

/* 返回顶部按钮 */
#backToTop {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    border: none;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

#backToTop.show {
    opacity: 1;
    visibility: visible;
}

#backToTop:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* 搜索框 */
.search-form .form-control {
    border-radius: 25px 0 0 25px;
    border: 2px solid transparent;
    background: rgba(255,255,255,0.1);
    color: white;
    padding: 0.75rem 1.25rem;
}

.search-form .form-control::placeholder {
    color: rgba(255,255,255,0.7);
}

.search-form .form-control:focus {
    background: rgba(255,255,255,0.15);
    box-shadow: none;
    border-color: rgba(255,255,255,0.3);
}

.search-form .btn {
    border-radius: 0 25px 25px 0;
    padding: 0.75rem 1.5rem;
    background: rgba(255,255,255,0.1);
    border: none;
}

/* 用户头像 */
.avatar {
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: var(--shadow-sm);
}

/* 按钮 */
.btn {
    border-radius: 10px;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--gradient-primary);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--gradient-primary);
    border-color: transparent;
    transform: translateY(-2px);
}

/* 表单 */
.form-control {
    border-radius: 10px;
    padding: 0.75rem 1.25rem;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-label {
    font-weight: 500;
    color: #4a5568;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(102, 126, 234, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeInUp 0.5s ease;
}

/* 响应式 */
@media (max-width: 992px) {
    .carousel-caption h2 {
        font-size: 2rem;
    }
    
    .carousel-item-content {
        height: 350px !important;
    }
}

@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .carousel-caption h2 {
        font-size: 1.5rem;
    }
    
    .carousel-item-content {
        height: 300px !important;
    }
    
    .article-content {
        font-size: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    footer {
        padding: 2rem 0 1rem;
    }
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #764ba2;
}

/* 选择文本颜色 */
::selection {
    background: var(--primary-color);
    color: white;
}

::-moz-selection {
    background: var(--primary-color);
    color: white;
}
