/**
 * Good 主题样式 - 模仿 sz.y899.cn 简洁白底蓝色调风格
 */

/* === CSS 变量 === */
:root {
    --primary: #4e6ef2;
    --primary-hover: #3b5de7;
    --primary-light: rgba(78, 110, 242, 0.08);
    --primary-lighter: #f0f3ff;
    --text-primary: #333;
    --text-secondary: #666;
    --text-muted: #999;
    --text-light: #bbb;
    --bg-body: #f5f7fa;
    --bg-white: #fff;
    --border-color: #e8ecf1;
    --border-light: #f0f0f0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: all 0.25s ease;
    --max-width: 1200px;
    --header-height: 60px;
}

/* === 全局 === */
* {
    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: var(--text-primary);
    line-height: 1.7;
    background: var(--bg-body);
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary);
}

::selection {
    background: var(--primary);
    color: #fff;
}

/* === 导航栏 - 白色固定顶部 === */
.navbar.sz-navbar {
    background: var(--bg-white) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    padding: 0;
    height: var(--header-height);
    z-index: 1050 !important;
    transition: var(--transition);
}

.navbar.sz-navbar.scrolled {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.navbar.sz-navbar .container {
    max-width: var(--max-width);
    height: 100%;
    display: flex;
    align-items: center;
}

.navbar.sz-navbar .navbar-brand {
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--text-primary) !important;
    padding: 0;
    height: var(--header-height);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.navbar.sz-navbar .navbar-brand img {
    max-height: 36px;
}

.navbar.sz-navbar .navbar-brand i {
    color: var(--primary);
    font-size: 1.3rem;
}

.navbar.sz-navbar .navbar-collapse {
    flex-grow: 1;
}

.navbar.sz-navbar .navbar-nav {
    align-items: center;
    gap: 0;
}

.navbar.sz-navbar .navbar-nav .nav-link {
    color: var(--text-secondary) !important;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.5rem 0.9rem !important;
    border-radius: 6px;
    transition: var(--transition);
    white-space: nowrap;
}

.navbar.sz-navbar .navbar-nav .nav-link:hover,
.navbar.sz-navbar .navbar-nav .nav-link.active {
    color: var(--primary) !important;
    background: var(--primary-light);
}

.navbar.sz-navbar .navbar-nav .nav-link i {
    margin-right: 0.3rem;
    font-size: 0.85rem;
}

.navbar.sz-navbar .dropdown-menu {
    border: none;
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius);
    padding: 0.5rem 0;
    margin-top: 0.5rem !important;
    min-width: 160px;
    z-index: 1100 !important;
}

.navbar.sz-navbar .dropdown-item {
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 0.55rem 1.1rem;
    transition: var(--transition);
}

.navbar.sz-navbar .dropdown-item:hover {
    background: var(--primary-light);
    color: var(--primary);
}

/* 导航栏搜索框 */
.navbar.sz-navbar .sz-search-box {
    margin-left: auto;
}

.navbar.sz-navbar .sz-search-box .input-group {
    border: 1.5px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    transition: var(--transition);
}

.navbar.sz-navbar .sz-search-box .input-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(78, 110, 242, 0.1);
}

.navbar.sz-navbar .sz-search-box .form-control {
    border: none;
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
    background: transparent;
    box-shadow: none !important;
    height: 36px;
}

.navbar.sz-navbar .sz-search-box .form-control:focus {
    box-shadow: none !important;
}

.navbar.sz-navbar .sz-search-box .btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    padding: 0.4rem 0.7rem;
    font-size: 0.85rem;
}

.navbar.sz-navbar .sz-search-box .btn:hover {
    color: var(--primary);
}

/* 导航栏用户按钮 */
.navbar.sz-navbar .btn-outline-sz {
    border: 1.5px solid var(--primary);
    color: var(--primary);
    font-size: 0.85rem;
    padding: 0.35rem 0.9rem;
    border-radius: 20px;
    background: transparent;
    font-weight: 500;
}

.navbar.sz-navbar .btn-outline-sz:hover {
    background: var(--primary);
    color: #fff;
}

.navbar.sz-navbar .btn-sz-primary {
    background: var(--primary);
    color: #fff;
    font-size: 0.85rem;
    padding: 0.35rem 0.9rem;
    border-radius: 20px;
    border: none;
    font-weight: 500;
}

.navbar.sz-navbar .btn-sz-primary:hover {
    background: var(--primary-hover);
    color: #fff;
}

/* === 主体布局 === */
.sz-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

/* === 幻灯片 / 轮播 === */
.sz-slide {
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.sz-slide .carousel-item-content {
    height: 320px;
    background-size: cover;
    background-position: center;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sz-slide .carousel-caption {
    max-width: 600px;
    text-shadow: none;
    text-align: left;
    left: 5%;
    right: auto;
    bottom: 15%;
}

.sz-slide .carousel-caption h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.6rem;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.sz-slide .carousel-caption p {
    font-size: 0.95rem;
    margin-bottom: 1rem;
    color: rgba(255,255,255,0.9);
}

.sz-slide .carousel-caption .btn {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 0.45rem 1.4rem;
    font-size: 0.9rem;
}

.sz-slide .carousel-indicators button {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin: 0 3px;
    border: none;
    opacity: 0.5;
    transition: var(--transition);
}

.sz-slide .carousel-indicators button.active {
    opacity: 1;
    width: 20px;
    border-radius: 4px;
    background: #fff;
}

.sz-slide .carousel-control-prev,
.sz-slide .carousel-control-next {
    width: 40px;
    height: 40px;
    top: 50%;
    transform: translateY(-50%);
    bottom: auto;
    opacity: 0;
    transition: opacity 0.3s;
}

.sz-slide:hover .carousel-control-prev,
.sz-slide:hover .carousel-control-next {
    opacity: 0.7;
}

.sz-slide .carousel-control-prev-icon,
.sz-slide .carousel-control-next-icon {
    width: 20px;
    height: 20px;
}

/* === 文章列表卡片 === */
.sz-post-item {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.sz-post-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: transparent;
}

.sz-post-item .sz-post-img {
    border-radius: 6px;
    overflow: hidden;
}

.sz-post-item .sz-post-img img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.sz-post-item:hover .sz-post-img img {
    transform: scale(1.05);
}

.sz-post-item .sz-post-title {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sz-post-item .sz-post-title:hover {
    color: var(--primary);
}

.sz-post-item .sz-post-title .badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-weight: 500;
    vertical-align: middle;
    margin-left: 0.3rem;
}

.sz-post-item .sz-post-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.sz-post-item .sz-post-meta a {
    color: var(--text-muted);
}

.sz-post-item .sz-post-meta a:hover {
    color: var(--primary);
}

.sz-post-item .sz-post-meta i {
    margin-right: 0.25rem;
    font-size: 0.75rem;
}

.sz-post-item .sz-post-intro {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 0.6rem;
}

.sz-post-item .sz-read-more {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 500;
}

.sz-post-item .sz-read-more:hover {
    text-decoration: underline;
}

/* === 文章详情 === */
.sz-article {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.sz-article .sz-article-title {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.sz-article .sz-article-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.sz-article .sz-article-meta a {
    color: var(--text-muted);
}

.sz-article .sz-article-meta a:hover {
    color: var(--primary);
}

.sz-article .sz-article-meta i {
    margin-right: 0.3rem;
}

/* 文章标签 */
.sz-article-tags {
    margin-bottom: 1rem;
}

.sz-article-tags .badge {
    background: var(--primary-light);
    color: var(--primary);
    border: none;
    font-size: 0.8rem;
    padding: 0.3rem 0.7rem;
    border-radius: 4px;
    font-weight: 500;
}

.sz-article-tags .badge:hover {
    background: var(--primary);
    color: #fff;
}

/* 文章摘要 */
.sz-article-summary {
    background: var(--primary-lighter);
    border-left: 3px solid var(--primary);
    padding: 1rem 1.25rem;
    border-radius: 0 var(--radius) var(--radius) 0;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* 文章正文 */
.sz-article-body {
    font-size: 1rem;
    line-height: 1.85;
    color: var(--text-primary);
    word-break: break-word;
}

.sz-article-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin: 1.5rem 0;
}

.sz-article-body p {
    margin-bottom: 1.25rem;
}

.sz-article-body h2, .sz-article-body h3, .sz-article-body h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.sz-article-body pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1.25rem;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 1.5rem 0;
    font-size: 0.9rem;
}

.sz-article-body blockquote {
    border-left: 3px solid var(--primary);
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    background: var(--primary-light);
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--text-secondary);
}

/* === 侧边栏 === */
.sz-sidebar-widget {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.sz-sidebar-widget .sz-widget-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    padding-bottom: 0.75rem;
    margin-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary);
    position: relative;
    display: inline-block;
}

.sz-sidebar-widget .sz-widget-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--primary);
}

.sz-sidebar-widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sz-sidebar-widget ul li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.9rem;
}

.sz-sidebar-widget ul li:last-child {
    border-bottom: none;
}

.sz-sidebar-widget ul li a {
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sz-sidebar-widget ul li a:hover {
    color: var(--primary);
}

/* 侧边栏带图列表 */
.sz-sidebar-widget .sz-side-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-light);
}

.sz-sidebar-widget .sz-side-item:last-child {
    border-bottom: none;
}

.sz-sidebar-widget .sz-side-item img {
    width: 80px;
    height: 54px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.sz-sidebar-widget .sz-side-item .sz-side-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sz-sidebar-widget .sz-side-item .sz-side-title:hover {
    color: var(--primary);
}

.sz-sidebar-widget .sz-side-item .sz-side-info {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* === 卡片公共样式覆盖 === */
.card {
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    background: var(--bg-white);
}

.card-header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.25rem;
    font-weight: 600;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    background: transparent;
    border-top: 1px solid var(--border-light);
    padding: 0.75rem 1.25rem;
}

/* === 分页 === */
.sz-pagination .page-link {
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin: 0 2px;
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
    transition: var(--transition);
}

.sz-pagination .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.sz-pagination .page-link:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

/* === 评论 === */
.sz-comment-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-light);
}

.sz-comment-item:last-child {
    border-bottom: none;
}

.sz-comment-item img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

/* === 评分 === */
.sz-score-star {
    color: #ddd;
    font-size: 1.25rem;
    cursor: pointer;
    transition: var(--transition);
}

.sz-score-star:hover, .sz-score-star.active {
    color: #ffc107;
    transform: scale(1.15);
}

/* === 页脚 === */
.sz-footer {
    background: #2b3340;
    color: #8d9baa;
    margin-top: 3rem;
    padding: 2.5rem 0 1.5rem;
}

.sz-footer .sz-footer-title {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.sz-footer .sz-footer-desc {
    font-size: 0.875rem;
    line-height: 1.7;
    color: #8d9baa;
}

.sz-footer .sz-footer-links li {
    margin-bottom: 0.4rem;
}

.sz-footer .sz-footer-link {
    color: #8d9baa;
    font-size: 0.875rem;
}

.sz-footer .sz-footer-link:hover {
    color: #fff;
    padding-left: 3px;
}

.sz-footer .sz-footer-contact li {
    font-size: 0.875rem;
    margin-bottom: 0.4rem;
}

.sz-footer .sz-footer-contact li i {
    color: var(--primary);
    margin-right: 0.4rem;
    width: 14px;
    text-align: center;
}

.sz-footer .sz-footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 1.25rem;
    margin-top: 1.5rem;
}

.sz-footer .sz-footer-copyright {
    color: #6b7a8a;
    font-size: 0.8rem;
}

.sz-footer .sz-footer-copyright a {
    color: #6b7a8a;
}

.sz-footer .sz-footer-copyright a:hover {
    color: #fff;
}

/* === 返回顶部 === */
.sz-back-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 999;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 0.9rem;
}

.sz-back-top.show {
    opacity: 1;
    visibility: visible;
}

.sz-back-top:hover {
    background: var(--primary-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    color: #fff;
}

/* === 按钮 === */
.btn-primary {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    border-radius: 6px;
    font-weight: 500;
}

.btn-primary:hover {
    background: var(--primary-hover) !important;
    border-color: var(--primary-hover) !important;
}

.btn-outline-primary {
    border-color: var(--primary) !important;
    color: var(--primary) !important;
    border-radius: 6px;
}

.btn-outline-primary:hover {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
}

/* === 表单 === */
.form-control {
    border: 1.5px solid var(--border-color);
    border-radius: 6px;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(78, 110, 242, 0.1);
}

/* === Badge === */
.badge {
    font-weight: 500;
    border-radius: 4px;
    padding: 0.3rem 0.65rem;
    font-size: 0.75rem;
}

/* === 面包屑 === */
.breadcrumb {
    font-size: 0.85rem;
    background: transparent;
    padding: 0;
    margin-bottom: 0;
}

.breadcrumb-item a {
    color: var(--text-muted);
}

.breadcrumb-item.active {
    color: var(--text-secondary);
}

/* === 阅读进度条 === */
.sz-reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--primary);
    z-index: 9999;
    transition: width 0.15s;
    border-radius: 0 2px 2px 0;
}

/* === 标签云 === */
.sz-tag-cloud .badge {
    background: var(--bg-body);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    margin: 0.2rem;
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
}

.sz-tag-cloud .badge:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* === Alert === */
.alert-info {
    background: var(--primary-lighter);
    border: 1px solid rgba(78, 110, 242, 0.15);
    color: var(--text-secondary);
    border-radius: var(--radius);
}

/* === 相关文章 === */
.sz-related-list li {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-light);
}

.sz-related-list li:last-child {
    border-bottom: none;
}

.sz-related-list li a {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.sz-related-list li a:hover {
    color: var(--primary);
}

/* === 滚动条 === */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #c8cdd5;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a0a8b5;
}

/* === 响应式 === */
@media (max-width: 992px) {
    .sz-slide .carousel-item-content {
        height: 250px;
    }

    .sz-article {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 54px;
    }

    .navbar.sz-navbar .navbar-brand {
        font-size: 1.1rem;
    }

    .sz-slide .carousel-item-content {
        height: 200px;
    }

    .sz-slide .carousel-caption h2 {
        font-size: 1.1rem;
    }

    .sz-slide .carousel-caption p {
        font-size: 0.85rem;
    }

    .sz-article .sz-article-title {
        font-size: 1.3rem;
    }

    .sz-article-body {
        font-size: 0.95rem;
    }

    .sz-post-item {
        padding: 1rem;
    }

    .sz-post-item .sz-post-title {
        font-size: 1rem;
    }

    .sz-footer {
        padding: 2rem 0 1rem;
    }
}

/* === 动画 === */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sz-animate-in {
    animation: fadeInUp 0.4s ease both;
}
