/* Bootstrap 自定义样式 */

:root {
    --bs-primary: #ff6b35;
    --bs-danger: #dc3545;
    --bs-warning: #ffc107;
}

body {
    background-color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* 导航栏样式 */
header {
    z-index: 1000;
}

.header-dark {
    background-color: #2a303c !important;
}

.logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.navbar-brand {
    padding: 0;
    margin-right: 0;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, 
        #ff0000 0%, 
        #ff6600 20%, 
        #ffcc00 40%, 
        #00cc00 60%, 
        #0066ff 80%, 
        #6600ff 100%);
    border-radius: 4px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-icon::before {
    content: '';
    position: absolute;
    width: 80%;
    height: 80%;
    background: 
        linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(255,255,255,0.1) 2px,
            rgba(255,255,255,0.1) 4px
        );
    border-radius: 2px;
}

.navbar-brand h1 {
    color: #1a1a1a;
    font-size: 1.5rem;
    margin: 0;
}

.navbar-brand small {
    color: #666;
    font-size: 0.7rem;
}

.header-dark .navbar-brand h1 {
    color: #fff !important;
}

.header-dark .navbar-brand small {
    color: rgba(255, 255, 255, 0.7) !important;
}

.header-dark .nav-link {
    color: rgba(255, 255, 255, 0.7) !important;
    transition: color 0.2s;
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
}

.header-dark .nav-link:hover {
    color: #fff !important;
}

.header-dark .nav-link.active {
    color: #fff !important;
    font-weight: 600;
}

.header-dark .btn-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
}

.header-dark .btn-link:hover {
    color: #fff;
}

.header-dark .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.3);
}

.header-dark .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.85%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* 卡片悬停效果 */
.card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/* 图片占位符 */
.image-placeholder-small {
    width: 100%;
    height: 120px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 0.375rem;
}

.image-placeholder-medium {
    width: 100%;
    height: 150px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 0.375rem;
}

.image-placeholder-large {
    width: 100%;
    max-width: 100%;
    height: 400px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 0.5rem;
}

.qr-placeholder-small {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 0.375rem;
}

/* 专题链接样式 */
.topic-link {
    transition: all 0.2s;
    background-color: #f8f9fa;
}

.topic-link:hover {
    background-color: #fff5f0;
    color: var(--bs-danger) !important;
    padding-left: 1rem !important;
    transform: translateX(4px);
}

/* 列表项悬停效果 */
.list-group-item:hover {
    background-color: #f8f9fa;
}

/* 文章内容样式 */
.article-content {
    font-size: 1rem;
    line-height: 1.8;
    color: #333;
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content h2 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

/* Badge 样式 */
.badge.rounded-circle {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

/* 链接样式 */
a {
    transition: color 0.2s;
}

a:hover {
    color: var(--bs-danger) !important;
}

/* 按钮样式 */
.btn-outline-secondary:hover {
    background-color: var(--bs-danger);
    border-color: var(--bs-danger);
    color: white;
}

.btn-outline-danger:hover {
    background-color: var(--bs-danger);
    border-color: var(--bs-danger);
    color: #fff !important;
}

/* 分页样式 */
.pagination .page-link {
    color: var(--bs-danger);
}

.pagination .page-item.active .page-link {
    background-color: var(--bs-danger);
    border-color: var(--bs-danger);
    color: #fff !important;
}

.pagination .page-link:hover {
    color: #fff !important;
    background-color: var(--bs-danger);
    border-color: var(--bs-danger);
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: #2a303c;
    color: #fff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: #1a1f28;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.back-to-top i {
    font-size: 1.2rem;
}

@media (max-width: 768px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .navbar-brand h1 {
        font-size: 1.25rem;
    }
    
    .article-content {
        font-size: 0.95rem;
    }
    
    .article-content h2 {
        font-size: 1.25rem;
    }
    
    .image-placeholder-large {
        height: 250px;
    }
}

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

/* 目录导航激活状态 */
.list-group-item.active {
    background-color: #fff5f0;
    color: var(--bs-danger);
    border-left: 3px solid var(--bs-danger) !important;
    padding-left: calc(1rem - 3px);
}

/* Footer 样式 */
.footer-dark {
    background-color: #2c3e50;
    color: #fff;
}

.footer-bottom-dark {
    background-color: #1a252f;
}

.footer-logo .logo-d {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, 
        #ff0000 0%, 
        #ff6600 20%, 
        #ffcc00 40%, 
        #00cc00 60%, 
        #0066ff 80%, 
        #6600ff 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 1.5rem;
    position: relative;
    overflow: hidden;
}

.footer-logo .logo-d::before {
    content: 'D';
    position: absolute;
    color: white;
    font-weight: bold;
    z-index: 1;
}

.footer-links a:hover {
    color: #fff !important;
}

.partners-link-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.partner-link {
    display: inline-block;
    transition: opacity 0.2s, transform 0.2s;
    opacity: 0.8;
}

.partner-link:hover {
    opacity: 1;
    transform: scale(1.05);
}

.partner-logo {
    max-width: 120px;
    height: auto;
    max-height: 40px;
    object-fit: contain;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 5px;
    border-radius: 4px;
}

.qr-placeholder-small {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 0.375rem;
    position: relative;
}

.qr-placeholder-small::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60%;
    height: 60%;
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    border-radius: 4px;
}

@media (max-width: 768px) {
    .partners-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .footer-bottom-dark .container {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
}

/* ===== 列表页文章项样式优化 ===== */
.article-item {
    padding: 0.8rem 0rem;
    transition: background-color 0.2s;
    border-bottom: 1px solid #e9ecef !important;
    margin: 0;
}

.article-item:last-child {
    border-bottom: none !important;
}

.article-item:hover {
    background-color: #f8f9fa;
    margin-left: 0;
    margin-right: 0;
}

/* 有缩略图的文章项 */
.article-item-with-image {
    min-height: 150px;
}

.article-item-with-image .col-md-8 {
    min-height: 150px;
}

.article-item-with-image .row {
    margin-left: 0;
    margin-right: 0;
}

/* 无缩略图的文章项 */
.article-item-no-image {
    padding: 0.8rem 1rem;
}

.article-item-no-image .article-title {
    margin-bottom: 0.75rem;
}

.article-item-no-image .article-excerpt {
    margin-bottom: 0.75rem;
}

/* 文章标题样式 - 更大 */
.article-title {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.article-title a {
    color: #1a1a1a;
    transition: color 0.2s;
}

.article-title a:hover {
    color: var(--bs-danger);
}

/* 文章描述样式 - 文本截断 */
.article-excerpt-wrapper {
    position: relative;
}

.article-excerpt {
    font-size: 0.875rem;
    line-height: 1.6;
    color: #6c757d;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0;
    transition: all 0.3s ease;
}

.article-excerpt-wrapper.expanded .article-excerpt {
    display: block;
    -webkit-line-clamp: unset;
    line-clamp: unset;
    overflow: visible;
}

.btn-expand-more {
    display: inline-block;
    margin-top: 0.25rem;
    cursor: pointer;
    font-size: 0.8125rem !important;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    color: var(--bs-danger) !important;
    text-decoration: none !important;
    transition: color 0.2s;
}

.btn-expand-more:hover {
    color: #c82333 !important;
    text-decoration: underline !important;
}

.btn-expand-more.hidden {
    display: none;
}

/* 文章元信息 - 固定在底部 */
.article-meta {
    font-size: 0.8125rem;
    color: #6c757d;
    margin-top: auto;
    padding-top: 0.5rem;
    flex-shrink: 0;
}

.article-meta span {
    display: inline-block;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .article-item {
        padding: 1rem;
    }
    
    .article-title {
        font-size: 1rem;
    }
    
    .article-excerpt {
        -webkit-line-clamp: 3;
        line-clamp: 3;
    }
    
    .article-item-with-image .col-md-4 {
        margin-bottom: 0.75rem;
    }
    
    .article-item-with-image .col-md-8 {
        min-height: auto;
    }
}

/* 文章背景图片容器样式 */
.article-bg-image {
    background-size: cover;
    background-position: center;
    border-radius: 0.375rem;
}

/* 文章背景图片渐变遮罩 */
.article-bg-overlay {
    background: linear-gradient(to top, rgba(0,0,0,0.7), rgba(0,0,0,0.3));
    border-radius: 0.375rem;
}

/* 轮播图背景图片容器样式 */
.carousel-bg-image {
    background-size: cover;
    background-position: center;
    height: 400px;
    border-radius: 0.375rem;
}

/* 轮播图渐变遮罩 */
.carousel-bg-overlay {
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    border-radius: 0.375rem;
}

