/* 主题色变量 */
:root {
    --theme-primary: #8b3a62;
    --theme-primary-dark: #4a1f3d;
    --theme-accent: #ff6b5b;
    --theme-accent-hover: #e85545;
    --theme-bg: #faf5f0;
    --theme-surface: #ffffff;
    --theme-text: #2c1e2a;
    --theme-text-muted: #7a6678;
    --theme-border: #e8dce3;
    --theme-link: #a13d72;
    --theme-shadow: rgba(74, 31, 61, 0.08);
}

/* 全局样式 */
body {
    background-color: var(--theme-bg);
    color: var(--theme-text);
    padding-top: 56px;
}

a {
    color: var(--theme-link);
}

a:hover {
    color: var(--theme-accent);
}

/* Bootstrap 主色覆盖 */
.btn-primary {
    background-color: var(--theme-primary);
    border-color: var(--theme-primary);
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--theme-primary-dark);
    border-color: var(--theme-primary-dark);
}

.btn-outline-primary {
    color: var(--theme-primary);
    border-color: var(--theme-primary);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background-color: var(--theme-primary);
    border-color: var(--theme-primary);
    color: #fff;
}

.text-primary {
    color: var(--theme-primary) !important;
}

/* 导航栏样式 */
.navbar {
    box-shadow: 0 2px 8px var(--theme-shadow);
    transition: all 0.3s ease;
}

.navbar.bg-dark,
.navbar.fixed-top {
    background-color: var(--theme-primary-dark) !important;
    backdrop-filter: blur(10px);
}

.navbar-brand {
    color: var(--theme-accent) !important;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.85);
    transition: color 0.2s ease;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link:focus {
    color: var(--theme-accent) !important;
}

.navbar-dark .navbar-nav .nav-item.active .nav-link,
.navbar-dark .navbar-nav .nav-link.active {
    color: var(--theme-accent) !important;
    font-weight: 600;
}

/* 侧栏标题 */
.sidebar h5,
.detail-sidebar h5 {
    color: var(--theme-primary-dark);
    font-weight: 600;
    border-left: 3px solid var(--theme-accent);
    padding-left: 10px !important;
}

/* 文章卡片样式 */
.article-card {
    margin-bottom: 20px;
    transition: transform 0.2s ease;
}

.article-card:hover {
    transform: translateY(-2px);
}

.article-card .card {
    border: none;
    background: var(--theme-surface);
    box-shadow: 0 2px 8px var(--theme-shadow);
    border-radius: 6px;
    overflow: hidden;
}

.article-card:hover .card {
    box-shadow: 0 4px 16px rgba(74, 31, 61, 0.12);
}

.article-card .card-body {
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
}

.article-card .card-title {
    font-size: 1rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    color: var(--theme-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card .text-muted {
    font-size: 0.85rem;
    color: var(--theme-text-muted) !important;
}

.article-card .card-img {
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.article-card .card-img-wrapper {
    height: 100%;
    padding: 0.5rem;
}

.article-card .card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-card .card-text {
    font-size: 0.875rem;
    color: var(--theme-text-muted);
}

/* 头条文章样式 */
.featured-article .card {
    border: none;
    box-shadow: 0 4px 12px rgba(74, 31, 61, 0.12);
    border-radius: 6px;
    overflow: hidden;
}

.featured-article img {
    height: 300px;
    object-fit: cover;
}

/* 轮播图 */
.carousel-caption {
    background: linear-gradient(transparent, rgba(74, 31, 61, 0.75));
    border-radius: 0 0 6px 6px;
}

.carousel-indicators li {
    background-color: var(--theme-accent);
}

/* 右侧推荐区样式 */
.sidebar {
    padding: 0;
    border-radius: 4px;
}

.recommended-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--theme-border);
}

.recommended-item:last-child {
    border-bottom: none;
}

.recommended-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
}

.recommended-card {
    transition: transform 0.2s ease;
}

.recommended-card:hover {
    transform: translateY(-3px);
}

.recommended-card img {
    aspect-ratio: 16/9;
    object-fit: cover;
    width: 100%;
    min-height: 120px;
}

.recommended-card .card-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--theme-text);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .featured-article img {
        height: 200px;
    }

    .article-card .card-img-wrapper {
        height: 80px;
        padding: 0.25rem;
    }

    .article-card .card-body {
        padding: 0.25rem 0.5rem;
    }

    .recommended-item img {
        height: 120px;
    }
}

/* 排行榜样式 */
.ranking-item {
    transition: all 0.2s ease;
    border-radius: 4px;
}

.ranking-item:hover {
    background-color: rgba(139, 58, 98, 0.06);
}

.ranking-item a {
    color: var(--theme-text);
}

.rank-number {
    width: 26px;
    height: 26px;
    line-height: 26px;
    text-align: center;
    font-weight: bold;
    font-size: 15px;
    border-radius: 4px;
    flex-shrink: 0;
}

.rank-1 {
    background-color: var(--theme-accent);
    color: white;
}

.rank-2 {
    background-color: var(--theme-primary);
    color: white;
}

.rank-3 {
    background-color: #5c4e9e;
    color: white;
}

.rank-other {
    background-color: var(--theme-border);
    color: var(--theme-text-muted);
}

.rank-title {
    font-size: 15px;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    white-space: normal;
    font-weight: 500;
}

.ranking-item:hover .rank-title {
    color: var(--theme-link) !important;
}

#loadMoreBtn {
    min-width: 120px;
    transition: all 0.3s ease;
    border-radius: 4px;
}

#loadMoreBtn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

#loadMoreBtn .spinner-border {
    margin-left: 8px;
    vertical-align: middle;
}

.page-loading {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.page-loading .spinner-border {
    width: 2.5rem;
    height: 2.5rem;
    color: var(--theme-primary);
}

@media (min-width: 992px) {
    #mainContentCol.mx-auto {
        float: none;
    }
}

.sidebar-container1 {
    position: sticky;
    top: 76px;
    max-height: calc(100vh - 86px);
    overflow: hidden;
    padding-right: 10px;
}

/* 自定义滚动条样式 */
.sidebar-container::-webkit-scrollbar {
    width: 4px;
}

.sidebar-container::-webkit-scrollbar-track {
    background: var(--theme-border);
}

.sidebar-container::-webkit-scrollbar-thumb {
    background: var(--theme-primary);
    border-radius: 4px;
}

.sidebar-container::-webkit-scrollbar-thumb:hover {
    background: var(--theme-primary-dark);
}

.recommended-list .row {
    margin-right: -10px;
}

/* 404 按钮 */
.btn-gtf-ltl-64 {
    display: inline-block;
    padding: 10px 28px;
    background-color: var(--theme-primary);
    color: #fff;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.btn-gtf-ltl-64:hover {
    background-color: var(--theme-primary-dark);
    color: #fff;
    text-decoration: none;
}

/* 详情页 */
.detail-article-wrap {
    background: var(--theme-surface);
    padding: 24px;
    border-radius: 6px;
    box-shadow: 0 2px 8px var(--theme-shadow);
}

#title {
    color: var(--theme-primary-dark) !important;
}

#detail-time {
    color: var(--theme-text-muted) !important;
}

/* 响应式调整 */
@media (max-width: 991.98px) {
    .sidebar-container {
        position: static;
        padding-right: 0;
        max-height: none;
    }
}

img[src=""] {
    display: none;
}
