/*
Theme Name: VPS Review
Author: vpsreview
Description: VPS主机测评博客主题
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: vps-review
*/

/* =============================================
   CSS Variables
   ============================================= */
:root {
    --red:        #e8372c;
    --red-dark:   #c42d24;
    --red-light:  #fdf0ef;
    --text:       #333;
    --text-2:     #666;
    --text-3:     #999;
    --bg:         #f4f4f4;
    --white:      #fff;
    --border:     #e5e5e5;
    --nav:        #2c2c2c;
    --radius:     4px;
    --shadow:     0 1px 4px rgba(0,0,0,.1);
    --font:       'PingFang SC','Microsoft YaHei',Arial,sans-serif;
}

/* =============================================
   Reset
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body { font-family: var(--font); font-size: 15px; line-height: 1.75; color: var(--text); background: var(--bg); }
a { color: var(--red); text-decoration: none; }
a:hover { color: var(--red-dark); }
img { max-width: 100%; height: auto; display: block; }

/* =============================================
   Layout
   ============================================= */
.wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.layout {
    display: flex;
    gap: 20px;
    padding: 18px 0 30px;
}

.main { flex: 1; min-width: 0; }

.sidebar { width: 260px; flex-shrink: 0; }

/* =============================================
   Header
   ============================================= */
#header {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.header-wrap {
    display: flex;
    align-items: center;
    height: 62px;
    gap: 20px;
}

.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.logo-box {
    width: 38px;
    height: 38px;
    background: var(--red);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
}

.logo-text { font-size: 20px; font-weight: 700; color: var(--text); }
.logo-text em { color: var(--red); font-style: normal; }
.logo-desc { font-size: 11px; color: var(--text-3); margin-top: 1px; }

.search-box {
    flex: 1;
    max-width: 300px;
    display: flex;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
}

.search-box:focus-within { border-color: var(--red); }

.search-box input {
    flex: 1;
    border: none;
    outline: none;
    padding: 6px 14px;
    font-size: 13px;
    font-family: var(--font);
    background: transparent;
}

.search-box button {
    border: none;
    background: var(--red);
    color: #fff;
    padding: 0 16px;
    cursor: pointer;
    font-size: 13px;
    font-family: var(--font);
}

.search-box button:hover { background: var(--red-dark); }

/* =============================================
   Navigation
   ============================================= */
#nav { background: var(--nav); }

.nav-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
}

.nav-list > li { position: relative; }

.nav-list > li > a {
    display: block;
    padding: 10px 16px;
    color: #ccc;
    font-size: 14px;
    white-space: nowrap;
}

.nav-list > li > a:hover,
.nav-list > li.current-menu-item > a {
    color: #fff;
    background: var(--red);
}

/* Dropdown */
.nav-list .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid var(--border);
    min-width: 160px;
    z-index: 999;
    list-style: none;
    padding: 5px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
}

.nav-list li:hover > .sub-menu { display: block; }

.nav-list .sub-menu li a {
    display: block;
    padding: 8px 16px;
    font-size: 13px;
    color: var(--text);
}

.nav-list .sub-menu li a:hover { color: var(--red); background: var(--red-light); }

/* =============================================
   Post Card（列表页）
   ============================================= */
.post-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 15px;
    overflow: hidden;
    transition: box-shadow .2s;
}

.post-card:hover { box-shadow: 0 3px 14px rgba(0,0,0,.1); }

.post-card.sticky { border-top: 3px solid var(--red); }

.card-inner { display: flex; }

.card-thumb {
    width: 210px;
    flex-shrink: 0;
    overflow: hidden;
    background: #eee;
}

.card-thumb img {
    width: 100%;
    height: 100%;
    min-height: 140px;
    object-fit: cover;
    transition: transform .3s;
}

.post-card:hover .card-thumb img { transform: scale(1.04); }

.card-body {
    flex: 1;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cat-tag {
    display: inline-block;
    background: var(--red);
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: var(--radius);
    font-weight: 600;
}

.cat-tag:hover { background: var(--red-dark); color: #fff; }

.top-tag {
    display: inline-block;
    background: #ff9500;
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: var(--radius);
    font-weight: 600;
}

.post-date { font-size: 12px; color: var(--text-3); }

.card-title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.45;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-title:hover { color: var(--red); }

.card-desc {
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-3);
}

.card-stats { display: flex; gap: 12px; }

.btn-more {
    font-size: 12px;
    color: var(--red);
    border: 1px solid var(--red);
    padding: 3px 10px;
    border-radius: var(--radius);
    white-space: nowrap;
    transition: all .2s;
}

.btn-more:hover { background: var(--red); color: #fff; }

/* =============================================
   Pagination
   ============================================= */
.pager {
    display: flex;
    justify-content: center;
    gap: 5px;
    padding: 18px 0 6px;
    flex-wrap: wrap;
}

.pager a,
.pager span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text);
    background: var(--white);
}

.pager a:hover,
.pager .current { background: var(--red); border-color: var(--red); color: #fff; }

/* =============================================
   Sidebar Widget
   ============================================= */
.widget {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 18px;
    overflow: hidden;
}

.widget-title {
    font-size: 14px;
    font-weight: 700;
    padding: 9px 13px;
    background: #f8f8f8;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 6px;
}

.widget-title::before {
    content: '';
    width: 3px;
    height: 13px;
    background: var(--red);
    border-radius: 2px;
    display: inline-block;
    flex-shrink: 0;
}

.widget-body { padding: 10px 13px; }

/* 热门推荐列表 */
.hot-list { list-style: none; padding: 0; margin: 0; }

.hot-list li {
    padding: 7px 0;
    border-bottom: 1px dashed var(--border);
    display: flex;
    gap: 7px;
    align-items: flex-start;
}

.hot-list li:last-child { border-bottom: none; padding-bottom: 0; }

.hot-list a { font-size: 13px; color: var(--text); line-height: 1.5; flex: 1; }
.hot-list a:hover { color: var(--red); }

.hot-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: var(--text-3);
    border-radius: 2px;
    flex-shrink: 0;
    margin-top: 1px;
}

.hot-list li:nth-child(1) .hot-num { background: var(--red); }
.hot-list li:nth-child(2) .hot-num { background: #ff6b35; }
.hot-list li:nth-child(3) .hot-num { background: #ffa000; }

/* 分类列表 */
.cat-list { list-style: none; padding: 0; margin: 0; }

.cat-list li { border-bottom: 1px solid var(--border); }
.cat-list li:last-child { border-bottom: none; }

.cat-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 0;
    font-size: 13px;
    color: var(--text);
}

.cat-list a:hover { color: var(--red); }

.cat-num {
    background: #f0f0f0;
    color: var(--text-3);
    font-size: 11px;
    padding: 1px 7px;
    border-radius: 10px;
}

/* 标签云 */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }

.tag-cloud a {
    font-size: 12px;
    padding: 3px 10px;
    background: #f0f0f0;
    color: var(--text-2);
    border-radius: 10px;
    border: 1px solid var(--border);
}

.tag-cloud a:hover { background: var(--red-light); color: var(--red); border-color: var(--red); }

/* =============================================
   Single Post（文章详情页）
   ============================================= */
.single-wrap {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 26px;
    margin-bottom: 16px;
}

.post-title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text);
    margin-bottom: 12px;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--text-3);
    padding-bottom: 13px;
    border-bottom: 1px dashed var(--border);
    margin-bottom: 16px;
}

.post-cover { margin-bottom: 16px; border-radius: var(--radius); overflow: hidden; }

/* 文章内容 */
.entry-content { font-size: 15px; line-height: 1.85; color: var(--text); }
.entry-content p { margin-bottom: 14px; }
.entry-content h2 { font-size: 18px; font-weight: 700; margin: 24px 0 10px; padding-left: 10px; border-left: 3px solid var(--red); }
.entry-content h3 { font-size: 16px; font-weight: 700; margin: 20px 0 8px; }
.entry-content a { color: var(--red); border-bottom: 1px dashed transparent; }
.entry-content a:hover { border-color: var(--red); }
.entry-content img { max-width: 100%; border-radius: var(--radius); margin: 10px 0; }
.entry-content ul, .entry-content ol { padding-left: 1.6em; margin-bottom: 14px; }
.entry-content li { margin-bottom: 4px; }
.entry-content blockquote { border-left: 3px solid var(--red); background: var(--red-light); padding: 10px 14px; margin: 14px 0; border-radius: 0 var(--radius) var(--radius) 0; font-size: 14px; color: var(--text-2); }
.entry-content code { font-family: Consolas,monospace; background: #f4f4f4; padding: 1px 5px; border-radius: 3px; font-size: 13px; color: #c0392b; }
.entry-content pre { background: #2d2d2d; color: #f8f8f2; padding: 14px 16px; border-radius: var(--radius); overflow-x: auto; margin: 14px 0; font-size: 13px; line-height: 1.6; position: relative; }
.entry-content pre code { background: none; color: inherit; padding: 0; }
.entry-content table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 14px; }
.entry-content th, .entry-content td { border: 1px solid var(--border); padding: 8px 12px; }
.entry-content th { background: #f5f5f5; font-weight: 600; }
.entry-content tr:nth-child(even) td { background: #fafafa; }

/* 标签 */
.post-tags { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--border); display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 13px; }
.post-tags .label { color: var(--text-3); }
.post-tags a { padding: 2px 10px; background: #f0f0f0; border: 1px solid var(--border); border-radius: 10px; color: var(--text-2); font-size: 12px; }
.post-tags a:hover { color: var(--red); border-color: var(--red); }

/* 上下篇 */
.post-nav { display: flex; justify-content: space-between; margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--border); gap: 10px; }
.post-nav-item { flex: 1; font-size: 13px; }
.post-nav-item.next { text-align: right; }
.post-nav-item .label { display: block; font-size: 11px; color: var(--text-3); margin-bottom: 3px; }
.post-nav-item a { color: var(--text); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-nav-item a:hover { color: var(--red); }

/* 相关文章 */
.related { margin-top: 20px; }
.related-title { font-size: 15px; font-weight: 700; margin-bottom: 12px; padding-left: 9px; border-left: 3px solid var(--red); }
.related-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.related-item { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.related-item:hover { box-shadow: var(--shadow); }
.related-item img { width: 100%; height: 95px; object-fit: cover; background: #eee; }
.related-item p { padding: 7px 9px; font-size: 12px; color: var(--text); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.related-item:hover p { color: var(--red); }

/* =============================================
   Comments
   ============================================= */
.comment-area {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 22px;
}

.comment-area .comment-title { font-size: 15px; font-weight: 700; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }

.comment-item { display: flex; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.comment-item:last-child { border-bottom: none; }
.comment-item img { border-radius: 50%; flex-shrink: 0; }
.comment-meta { font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.comment-meta .author { font-weight: 600; color: var(--text); margin-right: 8px; }
.comment-text { font-size: 14px; line-height: 1.7; }

/* comment form */
.comment-form-wrap { margin-top: 18px; }
.comment-form-wrap label { font-size: 13px; color: var(--text-2); display: block; margin-bottom: 5px; }
.comment-form-wrap input,
.comment-form-wrap textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 11px;
    font-size: 14px;
    font-family: var(--font);
    outline: none;
    margin-bottom: 10px;
    color: var(--text);
}
.comment-form-wrap input:focus,
.comment-form-wrap textarea:focus { border-color: var(--red); }
.comment-form-wrap textarea { min-height: 95px; resize: vertical; }
.comment-form-wrap .submit-btn { background: var(--red); color: #fff; border: none; padding: 9px 26px; border-radius: var(--radius); font-size: 14px; cursor: pointer; font-family: var(--font); }
.comment-form-wrap .submit-btn:hover { background: var(--red-dark); }

/* =============================================
   Breadcrumb
   ============================================= */
.breadcrumb { font-size: 12px; color: var(--text-3); padding: 8px 0 2px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.breadcrumb a { color: var(--text-2); }
.breadcrumb a:hover { color: var(--red); }

/* =============================================
   Footer
   ============================================= */
#footer { background: #2c2c2c; color: #888; margin-top: 20px; }

.footer-cols { display: grid; grid-template-columns: repeat(4,1fr); gap: 28px; padding: 28px 0 20px; border-bottom: 1px solid #3c3c3c; }

.footer-col-title { font-size: 14px; font-weight: 700; color: #ddd; margin-bottom: 10px; padding-bottom: 7px; border-bottom: 1px solid #3c3c3c; }

.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { padding: 4px 0; }
.footer-links a { font-size: 13px; color: #777; }
.footer-links a:hover { color: var(--red); }

.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; font-size: 13px; flex-wrap: wrap; gap: 8px; }
.footer-bottom a { color: #666; }
.footer-bottom a:hover { color: var(--red); }

/* =============================================
   404 / No Results
   ============================================= */
.box-empty { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 50px 20px; text-align: center; color: var(--text-2); }
.box-empty h2 { font-size: 20px; margin-bottom: 10px; color: var(--text); }
.box-empty .code { font-size: 64px; font-weight: 700; color: var(--red); line-height: 1; margin-bottom: 10px; }
.box-empty .home-btn { display: inline-block; margin-top: 14px; padding: 9px 26px; background: var(--red); color: #fff; border-radius: var(--radius); font-size: 14px; }

/* =============================================
   Responsive
   ============================================= */
@media (max-width: 960px) {
    .sidebar { width: 220px; }
    .card-thumb { width: 170px; }
    .footer-cols { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
    .layout { flex-direction: column; }
    .sidebar { width: 100%; }
    .card-inner { flex-direction: column; }
    .card-thumb { width: 100%; }
    .card-thumb img { min-height: 170px; }
    .nav-list { display: none; }
    .related-grid { grid-template-columns: 1fr 1fr; }
    .single-wrap { padding: 14px 15px; }
}

@media (max-width: 480px) {
    .related-grid { grid-template-columns: 1fr; }
    .footer-cols { grid-template-columns: 1fr; }
    .post-nav { flex-direction: column; }
}
