/*
Theme Name: LanyShyy Ops
Theme URI: https://lany-shyy-ops.com
Author: Your Name
Author URI: https://your-site.com
Description: 专为生产故障修复文档设计的 WordPress 主题，含导航树、悬浮目录、AJAX 筛选。
Version: 1.0
License: GPL v2 or later
Text Domain: lany-shyy-ops
*/

/* === 基础重置与变量 === */
:root {
    --accent: #7c3aed;
    --bg: #ffffff;
    --border: #e5e7eb;
    --text-primary: #0c0c0f;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --hero-bg: #110e1b;
    --font: 'Plus Jakarta Sans', system-ui, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
a { text-decoration: none; color: inherit; }
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}
@media (max-width: 768px) {
    .container { padding: 0 20px; }
}

/* === Header === */
.header-wrapper {
    position: sticky;
    top: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    z-index: 100;
    padding: 14px 0;
}
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 18px;
}
.brand .custom-logo {
    max-height: 40px;
    width: auto;
}
.site-tagline {
    font-size: 13px;
    color: var(--text-muted);
    border-left: 1px solid var(--border);
    padding-left: 16px;
    margin-left: 10px;
}
@media (max-width: 768px) {
    .site-tagline { display: none; }
}
.navlinks ul {
    display: flex;
    gap: 28px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    list-style: none;
}
.navlinks a:hover { color: var(--text-primary); }
.burger {
    display: none;
    background: none;
    border: none;
    flex-direction: column;
    gap: 5px;
    padding: 4px;
    cursor: pointer;
}
.burger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
}
@media (max-width: 768px) {
    .burger { display: flex; }
    .navlinks {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #fff;
        border-bottom: 1px solid var(--border);
        padding: 20px;
        z-index: 99;
    }
    .navlinks.active { display: block; }
    .navlinks ul { flex-direction: column; gap: 18px; }
}

/* === Hero === */
.hero-spotlight {
    padding: 80px 0 100px;
    background: var(--hero-bg);
    color: #fff;
    text-align: center;
}
.hero-spotlight__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #d1d5db;
    margin-bottom: 20px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    padding: 6px 16px;
    border-radius: 999px;
}
.hero-spotlight__dot {
    width: 6px; height: 6px;
    background: #ef4444;
    border-radius: 50%;
}
.hero-spotlight__title {
    font-size: 48px;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
}
.hero-spotlight__desc {
    font-size: 18px;
    color: #9ca3af;
    margin-bottom: 40px;
}
@media (max-width: 768px) {
    .hero-spotlight { padding: 50px 0 70px; }
    .hero-spotlight__title { font-size: 30px; }
}
@media (max-width: 480px) {
    .hero-spotlight__title { font-size: 24px; }
}

/* === 搜索栏 === */
.searchbar {
    display: flex;
    max-width: 560px;
    margin: 0 auto;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 999px;
    padding: 6px;
}
.searchbar input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px 20px;
    font-size: 15px;
    color: #fff;
    outline: none;
    font-family: inherit;
}
.searchbar input::placeholder { color: #6b7280; }
.searchbar .btn {
    padding: 10px 24px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 999px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
}
.searchbar .btn:hover { background: #6d28d9; }
@media (max-width: 768px) {
    .searchbar {
        flex-direction: column;
        background: transparent;
        border: none;
        padding: 0;
        gap: 12px;
    }
    .searchbar input {
        background: rgba(255,255,255,0.05);
        border: 1px solid rgba(255,255,255,0.15);
        border-radius: 999px;
    }
    .searchbar .btn { width: 100%; }
}

/* === 内容区域 === */
.spotlight-body {
    padding: 50px 0 80px;
}
.spotlight-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 12px;
}
.spotlight-section-head h2 {
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}
.chips {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.chip {
    padding: 6px 18px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    background: #fff;
    border: 1px solid var(--border);
}
.chip.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}
.chip:hover:not(.active) {
    background: #f3f4f6;
}

/* === 文章网格（双列） === */
.articles-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
@media (max-width: 900px) {
    .articles-grid { grid-template-columns: 1fr; }
}
.article-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px 26px 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    transition: box-shadow 0.25s, transform 0.2s;
    display: flex;
    flex-direction: column;
}
.article-card:hover {
    box-shadow: 0 8px 28px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}
.article-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.article-tag {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 12px;
    border-radius: 999px;
    background: #faebc7;
    color: var(--text-secondary);
}
.article-tag.error { background: #fef2f2; color: #dc2626; }
.article-tag.k8s { background: #eff6ff; color: #2563eb; }
.article-tag.ai { background: #f5f3ff; color: #7c3aed; }
.article-tag.db { background: #ecfdf5; color: #059669; }
.article-tag.net { background: #fefce8; color: #b45309; }
.article-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 8px;
}
.article-card:hover .article-title { color: var(--accent); }
.article-excerpt {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
    flex: 1;
}
.article-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-muted);
}
.article-category {
    font-weight: 600;
    color: var(--text-secondary);
}
.article-published { color: var(--text-muted); }

/* === 单页（single）布局 === */
.single-wrapper {
    display: flex;
    gap: 40px;
    padding: 40px 0 60px;
}
.single-main {
    flex: 1;
    min-width: 0;
}

.single-sidebar-right {
    width: 260px;
    flex-shrink: 0;
    position: sticky;
    top: 100px;          /* 与顶部保持距离，可根据 header 高度调整 */
    align-self: flex-start;
}
.single-sidebar-right {
    width: 260px;
    flex-shrink: 0;
    position: sticky;
    top: 100px;
    align-self: flex-start;
}
@media (max-width: 1024px) {
    .single-sidebar-left { display: none; }
    .single-sidebar-right { display: none; }
    .single-wrapper { flex-direction: column; }
}
/* 导航树样式 */
.nav-tree ul {
    list-style: none;
    padding-left: 0;
}
.nav-tree li {
    margin-bottom: 4px;
}
.nav-tree .cat-item {
    font-weight: 700;
    margin-top: 8px;
}
.nav-tree .cat-item ul {
    padding-left: 16px;
    font-weight: 400;
}
.nav-tree .current-post-item > a {
    color: var(--accent);
    font-weight: 600;
}

/* TOC样式 */
.toc-wrapper {
    background: #f9fafb;
    border-radius: 12px;
    padding: 20px;
}
.toc-title {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 12px;
}
.toc-list {
    list-style: none;
    padding-left: 0;
}
.toc-list li {
    margin-bottom: 6px;
    font-size: 14px;
}
.toc-list li a {
    color: var(--text-secondary);
    transition: color 0.2s;
}
.toc-list li a:hover,
.toc-list li a.active {
    color: var(--accent);
}
.toc-list .h3 {
    padding-left: 16px;
    font-size: 13px;
}

/* 推荐阅读 */
.related-posts {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border);
}
.related-posts h3 {
    font-size: 20px;
    margin-bottom: 20px;
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}
.related-item {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
}
.related-item h4 {
    font-size: 15px;
    margin-bottom: 6px;
}
.related-item .date {
    font-size: 12px;
    color: var(--text-muted);
}

/* === Footer === */
footer {
    background: #efefef;
    padding: 18px 0;
    color: var(--text-secondary);
    margin-top: auto;
}
.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}
.footer-copyright {
    font-weight: 700;
    color: var(--text-primary);
}
.footer-links ul {
    display: flex;
    gap: 22px;
    font-size: 14px;
    font-weight: 600;
    list-style: none;
}
.footer-links a:hover { color: var(--accent); }
@media (max-width: 768px) {
    .footer-content { flex-direction: column; text-align: center; }
    .footer-links ul { flex-wrap: wrap; justify-content: center; }
}

/* === 归档/搜索结果页 === */
.archive-header {
    padding: 40px 0 20px;
}
.archive-header h1 {
    font-size: 28px;
}




/* 文章页标题区域间距优化 */
.entry-header {
    margin-bottom: 30px;
}
.entry-title {
    margin-bottom: 10px;
}
.entry-meta {
    margin-top: 6px;
    font-size: 14px;
    color: var(--text-secondary);
}
.entry-content {
    margin-top: 0;
}


/* Logo 区域包裹 - 上下排列 */
.brand-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;  /* logo 与副标题间距，可调 */
}

/* 原有 brand 样式微调 */
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 18px;
    text-decoration: none;
    color: inherit;
}

/* 副标题样式 - 去掉边框和左内边距 */
.site-tagline {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.3;
    border-left: none;
    padding-left: 0;
    margin-left: 0;
    white-space: nowrap;  /* 不换行，如果太长可改为 normal */
}

/* 移动端适配 */
@media (max-width: 768px) {
    .brand-wrapper {
        flex: 1;
        min-width: 0;
    }
    .site-tagline {
        font-size: 11px;
        white-space: normal;  /* 手机端允许换行 */
    }
}

.view-all-btn:hover {
    background: var(--accent);
    color: #fff !important;
}


/* 导航树折叠样式 */
.nav-tree .cat-toggle {
    cursor: pointer;
    display: inline-block;
    padding: 4px 0;
    font-weight: 700;
    text-decoration: none;
    color: var(--text-primary);
}
.nav-tree .cat-toggle:hover {
    color: var(--accent);
}
.nav-tree .cat-toggle::before {
    content: '▸ ';
    font-size: 14px;
    transition: transform 0.2s;
}
.nav-tree .cat-toggle.open::before {
    content: '▾ ';
}
.nav-tree .sub-posts {
    padding-left: 20px;
    list-style: none;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.nav-tree .sub-posts li {
    margin-bottom: 3px;
}
.nav-tree .sub-posts li a {
    color: var(--text-secondary);
    font-size: 14px;
    text-decoration: none;
}
.nav-tree .sub-posts li a:hover {
    color: var(--accent);
}
.nav-tree .sub-posts .current-post-item a {
    color: var(--accent);
    font-weight: 600;
}
