/* ===== 基础重置 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    background: #f5f5f5;
    color: #555;
    font-size: 15px;
    line-height: 1.7;
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
}
a { color: #333d46; text-decoration: none; transition: color .2s ease; }
a:hover { color: #ff4b4b; }
img { max-width: 100%; display: block; border: 0; }
ul, ol { list-style: none; }
button { font-family: inherit; cursor: pointer; }
.muted { color: #999; font-size: 13px; }
.container { width: 1200px; max-width: calc(100% - 32px); margin: 0 auto; }

/* ===== 顶部条 ===== */
.topbar { background: #2a363c; color: #b9c2c7; font-size: 13px; }
.topbar-inner {
    display: flex; align-items: center; justify-content: space-between;
    height: 38px; gap: 16px; overflow: hidden;
}
.topbar-notice { display: flex; align-items: center; gap: 8px; min-width: 0; }
.notice-label {
    flex: none; background: #ff4b4b; color: #fff; font-size: 12px;
    padding: 1px 8px; border-radius: 2px;
}
.notice-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
a.notice-text { color: inherit; }
a.notice-text:hover { color: #fff; text-decoration: underline; }
.topbar-meta { display: flex; align-items: center; gap: 10px; flex: none; }
.topbar-divider { color: #4b5960; }
.topbar-admin { color: #dfe5e8; }
.topbar-admin:hover { color: #fff; }

/* ===== 头部 ===== */
.site-header { background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.06); position: relative; z-index: 50; }
.header-inner { display: flex; align-items: center; gap: 28px; height: 76px; }
.logo { display: flex; flex-direction: column; justify-content: center; flex: none; }
.logo img { height: 52px; width: auto; }
.logo-text { font-size: 24px; font-weight: 700; color: #2a363c; letter-spacing: 1px; line-height: 1.2; }
.logo-sub { font-size: 12px; color: #9aa3a8; letter-spacing: .5px; }
.logo:hover .logo-text { color: #ff4b4b; }

.main-nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.nav-link {
    position: relative; display: block; padding: 0 16px; line-height: 76px;
    font-size: 16px; color: #333d46;
}
.nav-link::after {
    content: ""; position: absolute; left: 50%; bottom: 16px; width: 0; height: 3px;
    background: #ff4b4b; border-radius: 2px; transform: translateX(-50%);
    transition: width .2s ease;
}
.nav-link:hover, .nav-link.is-active { color: #ff4b4b; }
.nav-link:hover::after, .nav-link.is-active::after { width: 26px; }

.header-search { display: flex; flex: none; height: 38px; border: 1px solid #e2e5e7; border-radius: 19px; overflow: hidden; background: #f8f9fa; }
.header-search input { width: 170px; border: 0; outline: none; background: transparent; padding: 0 16px; font-size: 14px; color: #333; }
.header-search button {
    border: 0; background: #ff4b4b; color: #fff; padding: 0 20px; font-size: 14px;
    transition: background .2s ease;
}
.header-search button:hover { background: #e63e3e; }

.menu-toggle { display: none; width: 40px; height: 34px; border: 1px solid #e4e7e9; background: #fff; border-radius: 4px; flex-direction: column; justify-content: center; gap: 5px; align-items: center; }
.menu-toggle span { display: block; width: 20px; height: 2px; background: #333d46; }

/* ===== 首页大图 ===== */
.hero { position: relative; height: 320px; overflow: hidden; background: #2a363c; }
.hero-slide {
    position: absolute; inset: 0; background-size: cover; background-position: center;
    opacity: 0; visibility: hidden; transition: opacity .7s ease, visibility .7s ease;
}
.hero-slide.is-active { opacity: 1; visibility: visible; position: relative; height: 100%; }
.hero-slide--gradient { background: linear-gradient(120deg, #2a363c 0%, #3d545e 55%, #596e77 100%); }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(23,32,37,.78) 0%, rgba(23,32,37,.45) 55%, rgba(23,32,37,.06) 100%); }
.hero-content { position: relative; z-index: 2; height: 100%; display: flex; flex-direction: column; justify-content: center; color: #fff; max-width: 1200px; }
.hero-content h1, .hero-content h2 { font-size: 36px; line-height: 1.35; font-weight: 700; letter-spacing: 1px; max-width: 680px; text-shadow: 0 2px 10px rgba(0,0,0,.35); }
.hero-content p { margin-top: 14px; font-size: 16px; color: #d9e1e5; max-width: 660px; }
.btn-primary {
    display: inline-block; margin-top: 26px; padding: 10px 30px; background: #ff4b4b;
    color: #fff; border-radius: 24px; font-size: 15px; width: fit-content;
    transition: background .2s ease, transform .2s ease;
}
.btn-primary:hover { background: #e63e3e; color: #fff; transform: translateY(-2px); }
.hero-dots { position: absolute; left: 0; right: 0; bottom: 18px; z-index: 5; display: flex; justify-content: center; gap: 8px; }
.hero-dot { width: 26px; height: 4px; border-radius: 2px; border: 0; background: rgba(255,255,255,.35); }
.hero-dot.is-active { background: #ff4b4b; }

/* ===== 主体布局 ===== */
.page-body { padding: 26px 0 48px; }
.layout { display: flex; align-items: flex-start; gap: 24px; }
.main-col { flex: 1; min-width: 0; }
.sidebar { width: 320px; flex: none; position: sticky; top: 16px; }

.section { margin-bottom: 26px; }
.section-head {
    display: flex; align-items: baseline; justify-content: space-between;
    border-bottom: 1px solid #ececec; padding-bottom: 12px; margin-bottom: 18px;
}
.section-title { position: relative; font-size: 20px; color: #2a363c; font-weight: 700; padding-left: 14px; line-height: 1.2; }
.section-title::before {
    content: ""; position: absolute; left: 0; top: 2px; bottom: 2px; width: 4px;
    background: #ff4b4b; border-radius: 2px;
}
.section-more { font-size: 13px; color: #999; }
.category-desc {
    background: #fff; border-left: 3px solid #ff4b4b; padding: 12px 16px;
    color: #777; font-size: 14px; margin-bottom: 18px; border-radius: 0 4px 4px 0;
}

/* ===== 精选推荐 ===== */
.featured-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.featured-card { background: #fff; border-radius: 6px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.05); transition: box-shadow .2s ease, transform .2s ease; }
.featured-card:hover { box-shadow: 0 8px 22px rgba(0,0,0,.08); transform: translateY(-2px); }
.featured-thumb { display: block; height: 180px; overflow: hidden; background: #dfe4e6; }
.featured-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.featured-card:hover .featured-thumb img { transform: scale(1.04); }
.featured-body { padding: 14px 16px 16px; }
.featured-body h3 { font-size: 17px; line-height: 1.5; margin: 6px 0 8px; font-weight: 600; }
.featured-body h3 a { color: #2a363c; }
.featured-body h3 a:hover { color: #ff4b4b; }
.featured-body p { font-size: 13px; color: #8b949a; line-height: 1.7; margin-bottom: 10px; }

.post-cat {
    display: inline-block; font-size: 12px; color: #ff4b4b; background: #fff1f1;
    padding: 1px 8px; border-radius: 2px;
}
.post-cat:hover { background: #ff4b4b; color: #fff; }

.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 12px; color: #a2abb0; }
.badge-top, .badge-rec { padding: 0 6px; border-radius: 2px; font-size: 11px; }
.badge-top { background: #333d46; color: #fff; }
.badge-rec { background: #ff4b4b; color: #fff; }

/* ===== 文章列表 ===== */
.post-list { display: flex; flex-direction: column; gap: 16px; }
.post-item {
    display: flex; gap: 18px; background: #fff; border-radius: 6px; padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,.04); transition: box-shadow .2s ease;
}
.post-item:hover { box-shadow: 0 6px 18px rgba(0,0,0,.07); }
.post-thumb { flex: none; width: 220px; height: 140px; border-radius: 4px; overflow: hidden; background: #dfe4e6; }
.post-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.post-item:hover .post-thumb img { transform: scale(1.04); }
.thumb-empty {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #3b4b53, #5d7079); color: #fff; font-size: 15px; letter-spacing: 1px;
}
.post-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.post-title { font-size: 18px; font-weight: 600; line-height: 1.5; margin-bottom: 8px; }
.post-title a { color: #2a363c; }
.post-title a:hover { color: #ff4b4b; }
.post-summary { flex: 1; font-size: 13px; color: #8b949a; line-height: 1.75; margin-bottom: 10px; overflow: hidden; }

/* ===== 分页 ===== */
.pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 24px; }
.page-btn {
    display: inline-block; min-width: 36px; height: 34px; line-height: 32px; padding: 0 12px;
    text-align: center; background: #fff; border: 1px solid #e6e9eb; border-radius: 4px;
    font-size: 13px; color: #555;
}
.page-btn:hover { border-color: #ff4b4b; color: #ff4b4b; }
.page-btn.is-current { background: #ff4b4b; border-color: #ff4b4b; color: #fff; }
.page-btn.is-disabled { color: #c2c8cc; cursor: not-allowed; }
.page-total { margin-left: auto; font-size: 13px; color: #999; }

/* ===== 侧边栏 ===== */
.widget { background: #fff; border-radius: 6px; padding: 16px 18px; margin-bottom: 18px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.widget-title {
    position: relative; font-size: 17px; color: #2a363c; font-weight: 700;
    padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px solid #f0f0f0;
}
.widget-title::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 42px; height: 2px; background: #ff4b4b; }
.site-intro strong { display: block; color: #2a363c; margin-bottom: 6px; font-size: 15px; }
.site-intro p { font-size: 13px; color: #8b949a; line-height: 1.8; }

.cat-list li { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px dashed #f0f0f0; }
.cat-list li:last-child { border-bottom: 0; }
.cat-list a { display: block; padding: 9px 0 9px 14px; position: relative; font-size: 14px; }
.cat-list a::before {
    content: ""; position: absolute; left: 0; top: 50%; width: 5px; height: 5px;
    background: #d6dadd; border-radius: 50%; transform: translateY(-50%);
    transition: background .2s ease;
}
.cat-list a:hover::before { background: #ff4b4b; }
.cat-count { font-size: 12px; color: #a7afb4; background: #f6f7f8; padding: 1px 8px; border-radius: 10px; }

.hot-list li { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px dashed #f0f0f0; }
.hot-list li:last-child { border-bottom: 0; }
.hot-index {
    flex: none; width: 20px; height: 20px; line-height: 20px; text-align: center;
    background: #eef0f1; color: #8b949a; border-radius: 3px; font-size: 12px; margin-top: 2px;
}
.hot-list li:nth-child(1) .hot-index { background: #ff4b4b; color: #fff; }
.hot-list li:nth-child(2) .hot-index { background: #ff7b4b; color: #fff; }
.hot-list li:nth-child(3) .hot-index { background: #ffa84b; color: #fff; }
.hot-info { min-width: 0; }
.hot-info a { display: block; font-size: 14px; line-height: 1.55; color: #444; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.hot-info a:hover { color: #ff4b4b; }
.hot-date { font-size: 12px; color: #b0b7bb; }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud a {
    font-size: 12px; color: #6d777d; background: #f5f6f7; border-radius: 3px;
    padding: 3px 10px; transition: all .2s ease;
}
.tag-cloud a:hover { background: #ff4b4b; color: #fff; }

.friend-links { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.friend-links a { font-size: 13px; color: #7c868c; }
.friend-links a:hover { color: #ff4b4b; }

/* ===== 面包屑 ===== */
.breadcrumb { font-size: 13px; color: #a2abb0; margin-bottom: 18px; display: flex; gap: 6px; align-items: center; }
.breadcrumb a { color: #7c868c; }
.breadcrumb a:hover { color: #ff4b4b; }

/* ===== 文章详情 ===== */
.article-card { background: #fff; border-radius: 6px; padding: 30px 34px 24px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.article-head { border-bottom: 1px solid #f0f0f0; padding-bottom: 18px; }
.article-head h1 { font-size: 28px; line-height: 1.5; color: #2a363c; font-weight: 700; margin-bottom: 14px; }
.article-meta { display: flex; flex-wrap: wrap; gap: 18px; font-size: 13px; color: #9aa3a8; }
.article-meta a { color: #ff4b4b; }
.article-summary {
    margin: 20px 0 0; background: #f8f9fa; border-left: 3px solid #ff4b4b;
    padding: 14px 18px; color: #6d777d; font-size: 14px; line-height: 1.8; border-radius: 0 4px 4px 0;
}
.article-cover { margin-top: 20px; border-radius: 6px; overflow: hidden; }
.article-cover img { width: 100%; height: auto; }
.article-content { padding: 24px 0 8px; color: #444; font-size: 16px; line-height: 1.95; }
.article-content h2 { font-size: 21px; color: #2a363c; margin: 28px 0 14px; padding-left: 12px; border-left: 4px solid #ff4b4b; line-height: 1.4; }
.article-content h3 { font-size: 18px; color: #333d46; margin: 22px 0 12px; }
.article-content p { margin-bottom: 16px; }
.article-content ul, .article-content ol { margin: 0 0 18px 22px; }
.article-content ul { list-style: disc; }
.article-content ol { list-style: decimal; }
.article-content li { margin-bottom: 8px; }
.article-content img { border-radius: 4px; margin: 16px auto; }
.article-content blockquote {
    background: #f8f9fa; border-left: 4px solid #dfe4e6; padding: 12px 18px;
    color: #6d777d; margin: 18px 0; font-size: 15px;
}
.article-content table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 14px; }
.article-content th, .article-content td { border: 1px solid #e8ebed; padding: 9px 12px; }
.article-content th { background: #f6f7f8; color: #333d46; }
.article-content a { color: #ff4b4b; text-decoration: underline; }

.article-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 16px 0; border-top: 1px solid #f0f0f0; font-size: 13px; color: #8b949a; }
.article-tags a { background: #f5f6f7; color: #6d777d; padding: 3px 10px; border-radius: 3px; font-size: 12px; }
.article-tags a:hover { background: #ff4b4b; color: #fff; }

.article-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; background: #f8f9fa; border-radius: 4px; padding: 16px 18px; margin-top: 8px; }
.article-nav-item { font-size: 13px; color: #8b949a; }
.article-nav-item a { display: block; margin-top: 4px; color: #444; font-size: 14px; }
.article-nav-item a:hover { color: #ff4b4b; }
.nav-label { color: #a7afb4; }

.related-section { margin-top: 26px; }
.related-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.related-card { background: #fff; border-radius: 6px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.related-thumb { display: block; height: 140px; overflow: hidden; background: #dfe4e6; }
.related-thumb img { width: 100%; height: 100%; object-fit: cover; }
.related-card h3 { font-size: 15px; font-weight: 600; line-height: 1.55; padding: 12px 14px 4px; }
.related-card h3 a { color: #333d46; }
.related-card h3 a:hover { color: #ff4b4b; }
.related-date { display: block; padding: 0 14px 14px; font-size: 12px; color: #b0b7bb; }

.empty-box { background: #fff; border-radius: 6px; padding: 60px 20px; text-align: center; color: #a2abb0; font-size: 15px; }
.error-code { font-size: 64px; font-weight: 700; color: #ff4b4b; line-height: 1.1; margin-bottom: 6px; }
.error-search { display: flex; max-width: 420px; margin: 22px auto 18px; height: 42px; border: 1px solid #e2e5e7; border-radius: 21px; overflow: hidden; background: #f8f9fa; }
.error-search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; padding: 0 18px; font-size: 14px; color: #333; }
.error-search button { flex: none; border: 0; background: #ff4b4b; color: #fff; padding: 0 24px; font-size: 14px; }
.error-search button:hover { background: #e63e3e; }
.error-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; font-size: 14px; }
.error-links a { color: #6d777d; }
.error-links a:hover { color: #ff4b4b; }

/* ===== 页脚 ===== */
.site-footer { background: #2a363c; color: #98a4aa; margin-top: 10px; }
.footer-main { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 40px; padding: 40px 0 30px; }
.footer-col h3 { color: #fff; font-size: 16px; margin-bottom: 14px; font-weight: 600; }
.footer-about p { font-size: 13px; line-height: 1.9; margin-bottom: 10px; }
.footer-contact { color: #7f8c92; font-size: 13px; }
.footer-links li { margin-bottom: 8px; }
.footer-links a { color: #98a4aa; font-size: 13px; }
.footer-links a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); }
.footer-bottom-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 16px 0; font-size: 12px; color: #7f8c92; }
.footer-admin { margin-left: auto; color: #7f8c92; }
.footer-admin:hover { color: #fff; }

/* ===== 返回顶部 ===== */
.back-top {
    position: fixed; right: 26px; bottom: 40px; width: 42px; height: 42px; border: 0;
    border-radius: 50%; background: rgba(42,54,60,.85); color: #fff; font-size: 20px;
    opacity: 0; visibility: hidden; transition: all .25s ease; z-index: 99;
}
.back-top.is-visible { opacity: 1; visibility: visible; }
.back-top:hover { background: #ff4b4b; }

/* ===== 响应式 ===== */
@media (max-width: 1100px) {
    .header-inner { gap: 16px; }
    .nav-link { padding: 0 10px; font-size: 15px; }
    .header-search input { width: 130px; }
    .sidebar { width: 290px; }
}

@media (max-width: 900px) {
    .topbar-meta span:not(.topbar-divider) { display: none; }
    .topbar-admin { display: inline-block; }
    .header-inner { min-height: 64px; height: auto; flex-wrap: wrap; padding: 8px 0; row-gap: 2px; }
    .logo-text { font-size: 20px; }
    .logo-sub { display: none; }
    .menu-toggle { display: flex; margin-left: auto; }
    .main-nav {
        display: none; order: 4; width: 100%; flex: none; flex-direction: column; align-items: stretch;
        gap: 0; border-top: 1px solid #f0f0f0; padding: 6px 0; margin-top: 6px;
    }
    .main-nav.is-open { display: flex; }
    .nav-link { line-height: 44px; padding: 0 8px; }
    .nav-link::after { display: none; }
    .header-search { order: 3; height: 34px; }
    .header-search input { width: 140px; }
    .hero { height: 280px; }
    .hero-content h1, .hero-content h2 { font-size: 28px; }
    .hero-content p { font-size: 14px; }
    .layout { flex-direction: column; }
    .sidebar { width: 100%; position: static; }
    .footer-main { grid-template-columns: 1fr 1fr; gap: 24px; }
    .footer-about { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
    .container { max-width: calc(100% - 24px); }
    .notice-text { max-width: 210px; }
    .hero { height: 240px; }
    .hero-content h1, .hero-content h2 { font-size: 22px; }
    .hero-content p { display: none; }
    .btn-primary { margin-top: 18px; padding: 8px 22px; font-size: 14px; }
    .featured-grid { grid-template-columns: 1fr; }
    .post-item { flex-direction: column; gap: 12px; padding: 12px; }
    .post-thumb { width: 100%; height: 180px; }
    .post-title { font-size: 16px; }
    .post-summary { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
    .article-card { padding: 20px 16px; }
    .article-head h1 { font-size: 21px; }
    .article-content { font-size: 15px; }
    .related-grid { grid-template-columns: 1fr; }
    .article-nav { grid-template-columns: 1fr; }
    .page-total { width: 100%; margin-left: 0; margin-top: 6px; }
    .footer-main { grid-template-columns: 1fr; }
    .back-top { right: 14px; bottom: 24px; }
}
