/*
Theme Name: 聚樊实业润滑百科
Theme URI: https://jvfanshiye.com
Author: 聚樊实业
Description: 润滑百科专用轻量主题 — 专注中文阅读体验，零外部依赖，与官网深蓝风格统一
Version: 1.0
Requires PHP: 7.4
Text Domain: jvfanshiye
*/

/* ============================================
   设计令牌（与官网 index.html 保持一致）
   ============================================ */
:root {
    --navy-darkest: #080F1A;
    --navy-deep:    #0F1D2E;
    --navy:         #162D47;
    --steel:        #2C5F9E;
    --steel-light:  #4A7BBF;
    --accent:       #C8965A;
    --accent-hover: #D4A86A;
    --text:         #2C3E50;
    --text-light:   #5A6C7D;
    --text-muted:   #8899A6;
    --bg:           #F8F9FA;
    --white:        #FFFFFF;
    --border:       #E2E6EA;
    --font:         -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
}

/* ============================================
   基础重置
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   导航栏
   ============================================ */
.site-header {
    background: var(--navy-darkest);
    border-bottom: 1px solid rgba(255,255,255,.08);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}
.header-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}
.site-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.site-brand img {
    height: 32px;
    width: auto;
}
.site-brand span {
    color: var(--white);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: .5px;
}
.header-nav {
    display: flex;
    align-items: center;
    gap: 24px;
}
.header-nav a {
    color: rgba(255,255,255,.75);
    text-decoration: none;
    font-size: 13px;
    letter-spacing: .5px;
    transition: color .2s;
}
.header-nav a:hover { color: var(--white); }
.header-nav .btn-back {
    display: inline-block;
    padding: 7px 18px;
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 3px;
    color: var(--white);
    font-size: 12px;
    transition: all .2s;
}
.header-nav .btn-back:hover {
    background: rgba(255,255,255,.1);
    border-color: rgba(255,255,255,.5);
}

/* 移动端 */
@media (max-width: 640px) {
    .header-inner { height: 52px; padding: 0 16px; }
    .site-brand img { height: 26px; }
    .site-brand span { font-size: 13px; }
    .header-nav a { font-size: 12px; }
}

/* ============================================
   主内容区域
   ============================================ */
.site-main {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 24px 60px;
}

/* ── 文章列表页标题 ── */
.page-header {
    text-align: center;
    padding: 48px 0 40px;
}
.page-header .section-label {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 3px;
    color: var(--steel);
    text-transform: uppercase;
    margin-bottom: 12px;
}
.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--navy-darkest);
    letter-spacing: 1px;
    margin-bottom: 10px;
}
.page-header .page-desc {
    font-size: 15px;
    color: var(--text-light);
    font-weight: 300;
}

/* ── 文章列表 ── */
.article-list {
    display: flex;
    flex-direction: column;
    gap: 28px;
}
.article-item {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
    transition: box-shadow .25s, transform .25s;
    display: flex;
    flex-direction: column;
}
.article-item:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,.08);
    transform: translateY(-2px);
}
.article-thumb {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--navy-deep);
}
.article-thumb-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,.3);
    font-size: 36px;
    letter-spacing: 4px;
}
.article-body {
    padding: 24px 28px;
}
.article-body h2 {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
}
.article-body h2 a {
    color: var(--navy-darkest);
    text-decoration: none;
    transition: color .2s;
}
.article-body h2 a:hover { color: var(--steel); }
.article-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.article-excerpt {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.75;
}
.article-readmore {
    display: inline-block;
    margin-top: 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--steel);
    text-decoration: none;
    letter-spacing: .5px;
    transition: letter-spacing .2s;
}
.article-readmore:hover { letter-spacing: 1.5px; }

/* ── 分页 ── */
.pagination {
    text-align: center;
    margin-top: 48px;
    display: flex;
    justify-content: center;
    gap: 8px;
}
.pagination a, .pagination span {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    text-decoration: none;
    color: var(--text);
    border: 1px solid var(--border);
    transition: all .2s;
}
.pagination a:hover { background: var(--steel); color: var(--white); border-color: var(--steel); }
.pagination .current { background: var(--steel); color: var(--white); border-color: var(--steel); }

/* ============================================
   单篇文章页
   ============================================ */
.single-post .site-main {
    max-width: 780px;
}
.article-full {
    background: var(--white);
    border-radius: 8px;
    padding: 40px 36px;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.article-full .article-category {
    display: inline-block;
    font-size: 12px;
    font-weight: 500;
    color: var(--steel);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 16px;
}
.article-full h1 {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--navy-darkest);
    margin-bottom: 16px;
}
.article-full .article-meta {
    font-size: 13px;
    color: var(--text-muted);
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
}
.article-full .article-content {
    font-size: 16px;
    line-height: 1.9;
    color: var(--text);
}
/* 文章内容排版 */
.article-content h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--navy-darkest);
    margin: 36px 0 16px;
    padding-left: 12px;
    border-left: 3px solid var(--steel);
}
.article-content h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--navy);
    margin: 28px 0 12px;
}
.article-content p {
    margin-bottom: 16px;
}
.article-content ul, .article-content ol {
    margin: 0 0 16px 20px;
}
.article-content li {
    margin-bottom: 8px;
}
.article-content blockquote {
    margin: 20px 0;
    padding: 16px 20px;
    background: #F4F6F8;
    border-left: 4px solid var(--steel);
    color: var(--text-light);
    font-size: 15px;
    border-radius: 0 4px 4px 0;
}
.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 20px 0;
}
.article-content a {
    color: var(--steel);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 14px;
}
.article-content th, .article-content td {
    padding: 10px 14px;
    border: 1px solid var(--border);
    text-align: left;
}
.article-content th {
    background: var(--navy);
    color: var(--white);
    font-weight: 500;
}
.article-content code {
    background: #F0F2F4;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: .9em;
    color: var(--navy);
}
.article-content pre {
    background: var(--navy-darkest);
    color: #CDD9E5;
    padding: 20px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 20px 0;
    font-size: 13px;
    line-height: 1.6;
}

/* ── 文章底部导航 ── */
.article-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    gap: 20px;
}
.article-nav a {
    font-size: 13px;
    color: var(--steel);
    text-decoration: none;
    transition: color .2s;
    flex: 1;
}
.article-nav a:hover { color: var(--navy); }
.article-nav .nav-next { text-align: right; }

/* ============================================
   页脚
   ============================================ */
.site-footer {
    background: var(--navy-darkest);
    color: rgba(255,255,255,.5);
    text-align: center;
    padding: 32px 24px;
    font-size: 13px;
    line-height: 1.8;
}
.site-footer a {
    color: var(--steel-light);
    text-decoration: none;
}
.site-footer a:hover { color: var(--white); }

/* ============================================
   搜索框
   ============================================ */
.search-form {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
}
.search-form input[type="search"] {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 14px;
    font-family: var(--font);
    outline: none;
    transition: border-color .2s;
}
.search-form input[type="search"]:focus {
    border-color: var(--steel);
}
.search-form button {
    padding: 10px 24px;
    background: var(--steel);
    color: var(--white);
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-family: var(--font);
    cursor: pointer;
    transition: background .2s;
}
.search-form button:hover { background: var(--navy); }

/* ============================================
   404 页面
   ============================================ */
.error-404 {
    text-align: center;
    padding: 80px 24px;
}
.error-404 h1 { font-size: 72px; color: var(--steel); margin-bottom: 16px; }
.error-404 p { color: var(--text-light); margin-bottom: 24px; }
.error-404 a { color: var(--steel); }

/* ============================================
   移动端适配
   ============================================ */
@media (max-width: 640px) {
    .site-main { padding: 24px 16px 40px; }
    .page-header { padding: 32px 0 28px; }
    .page-header h1 { font-size: 22px; }
    .article-item .article-body { padding: 18px 20px; }
    .article-body h2 { font-size: 17px; }
    .article-thumb, .article-thumb-placeholder { height: 160px; }
    .article-full { padding: 24px 20px; }
    .article-full h1 { font-size: 22px; }
    .article-content { font-size: 15px; }
    .article-nav { flex-direction: column; gap: 12px; }
}
