/**
 * Main Theme Stylesheet
 * Lemonx Starter Theme
 */

/* ========================================
   Top Bar Styles
   ======================================== */
.lx-topbar {
    background-color: var(--lx-gray-900);
    color: white;
    padding: 0.75rem 0;
    font-size: 0.875rem;
    text-align: center;
    border-bottom: 1px solid var(--lx-gray-800);
}

/* ========================================
   Header Styles
   ======================================== */
.lx-header {
    background-color: var(--lx-gray-50);
    border-bottom: 1px solid var(--lx-gray-200);
    padding: 1rem 0;
    z-index: 100;
}

.lx-header--sticky {
    position: sticky;
    top: 0;
}

.lx-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--lx-space-lg);
    flex-wrap: wrap;
}

.lx-logo {
    flex-shrink: 0;
    order: 1;
}

.lx-nav {
    flex-grow: 1;
    order: 2;
}

/* 移动端菜单切换按钮 */
.lx-menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    margin-left: auto;
    z-index: 50;
}

.lx-menu-toggle-icon {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.lx-hamburger {
    width: 24px;
    height: 2px;
    background-color: var(--lx-gray-900);
    transition: var(--lx-transition);
    border-radius: 1px;
}

.lx-menu-toggle[aria-expanded="true"] .lx-hamburger:nth-child(1) {
    transform: rotate(45deg) translateY(8px);
}

.lx-menu-toggle[aria-expanded="true"] .lx-hamburger:nth-child(2) {
    opacity: 0;
}

.lx-menu-toggle[aria-expanded="true"] .lx-hamburger:nth-child(3) {
    transform: rotate(-45deg) translateY(-8px);
}

.lx-header-search {
    order: 3;
    flex-shrink: 0;
}

.lx-logo a,
.lx-site-title {
    display: inline-block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--lx-gray-900);
    text-decoration: none;
    transition: var(--lx-transition);
}

.lx-logo a:hover,
.lx-site-title:hover {
    color: var(--lx-primary);
}

.lx-logo img {
    max-height: 60px;
    width: auto;
}

.lx-nav {
    flex-grow: 1;
}

.lx-menu {
    display: flex;
    list-style: none;
    gap: 0;
    margin: 0;
    padding: 0;
}

.lx-menu > li {
    position: relative;
}

.lx-menu > li > a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--lx-gray-900);
    font-weight: 500;
    transition: var(--lx-transition);
}

.lx-menu > li > a:hover,
.lx-menu > li.current-menu-item > a {
    color: var(--lx-primary);
}

/* 子菜单 */
.lx-menu ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: white;
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
    border: 1px solid var(--lx-gray-200);
    border-radius: var(--lx-radius-md);
    min-width: 200px;
    box-shadow: var(--lx-shadow-md);
}

.lx-menu > li:hover > ul {
    display: block;
}

.lx-menu ul li {
    margin: 0;
}

.lx-menu ul li a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--lx-gray-900);
    font-weight: 400;
    transition: var(--lx-transition);
}

.lx-menu ul li a:hover {
    background-color: var(--lx-gray-100);
    color: var(--lx-primary);
}

/* 搜索框样式 */
.lx-header-search {
    display: flex;
    align-items: center;
}

.lx-header-search form {
    display: flex;
    gap: 0.5rem;
}

.lx-header-search input[type="search"],
.lx-header-search input[type="text"] {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--lx-gray-300);
    border-radius: var(--lx-radius-md);
    font-size: 0.875rem;
    min-width: 150px;
}

.lx-header-search input[type="search"]:focus,
.lx-header-search input[type="text"]:focus {
    outline: none;
    border-color: var(--lx-primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.lx-header-search button,
.lx-header-search input[type="submit"] {
    padding: 0.5rem 1rem;
    background-color: var(--lx-primary);
    color: white;
    border: none;
    border-radius: var(--lx-radius-md);
    cursor: pointer;
    font-size: 0.875rem;
    transition: var(--lx-transition);
}

.lx-header-search button:hover,
.lx-header-search input[type="submit"]:hover {
    background-color: var(--lx-primary-hover);
}

/* ========================================
   搜索表单样式（searchform.php）
   ======================================== */
.lx-search-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lx-search-label {
    display: flex;
    align-items: center;
    flex-grow: 1;
}

.lx-search-input {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--lx-gray-300);
    border-radius: var(--lx-radius-md);
    font-size: 0.875rem;
    width: 100%;
}

.lx-search-input:focus {
    outline: none;
    border-color: var(--lx-primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.lx-search-button {
    padding: 0.5rem 0.75rem;
    background-color: var(--lx-primary);
    color: white;
    border: none;
    border-radius: var(--lx-radius-md);
    cursor: pointer;
    font-size: 0.875rem;
    transition: var(--lx-transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
}

.lx-search-button:hover {
    background-color: var(--lx-primary-hover);
}

.lx-search-icon {
    display: inline-block;
    font-size: 1rem;
}

/* ========================================
   Main Content Styles
   ======================================== */
.lx-main {
    padding: var(--lx-space-2xl) 0;
    min-height: 400px;
}

.lx-content-wrapper {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: var(--lx-space-xl);
}

.lx-content {
    grid-column: 1;
}

.lx-sidebar {
    grid-column: 2;
    grid-row: 1;
}

/* ========================================
   Post Styles
   ======================================== */
.lx-post {
    margin-bottom: var(--lx-space-2xl);
    padding-bottom: var(--lx-space-2xl);
    border-bottom: 1px solid var(--lx-gray-200);
}

.lx-post:last-child {
    border-bottom: none;
}

.lx-post-header {
    margin-bottom: var(--lx-space-lg);
}

.lx-post-title {
    margin: 0 0 0.5rem;
    font-size: 2rem;
    color: var(--lx-gray-900);
}

.lx-post-meta {
    display: flex;
    gap: var(--lx-space-md);
    font-size: 0.875rem;
    color: var(--lx-gray-500);
}

.lx-post-meta a {
    color: var(--lx-primary);
}

.lx-post-thumbnail {
    margin-bottom: var(--lx-space-lg);
    border-radius: var(--lx-radius-lg);
    overflow: hidden;
}

.lx-post-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}

.lx-post-content {
    margin-bottom: var(--lx-space-lg);
    line-height: 1.8;
}

.lx-post-content p {
    margin-bottom: 1.5rem;
}

.lx-post-content h2,
.lx-post-content h3,
.lx-post-content h4 {
    margin: 2rem 0 1rem;
}

.lx-post-content ul,
.lx-post-content ol {
    margin: 0 0 1.5rem var(--lx-space-lg);
    padding: 0;
}

.lx-post-content li {
    margin-bottom: 0.5rem;
}

.lx-post-content blockquote {
    margin: 2rem 0;
    padding: var(--lx-space-md) var(--lx-space-lg);
    border-left: 4px solid var(--lx-primary);
    background-color: var(--lx-gray-50);
    font-style: italic;
    color: var(--lx-gray-700);
}

.lx-post-content code {
    background-color: var(--lx-gray-100);
    padding: 0.2rem 0.4rem;
    border-radius: var(--lx-radius-sm);
    font-family: var(--lx-font-mono);
    font-size: 0.875rem;
}

.lx-post-content pre {
    background-color: var(--lx-gray-900);
    color: #e5e7eb;
    padding: var(--lx-space-md);
    border-radius: var(--lx-radius-md);
    overflow-x: auto;
    margin: 0 0 1.5rem;
}

.lx-post-content pre code {
    background-color: transparent;
    padding: 0;
    color: #e5e7eb;
}

.lx-post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.lx-post-content table th,
.lx-post-content table td {
    border: 1px solid var(--lx-gray-300);
    padding: 0.75rem;
    text-align: left;
}

.lx-post-content table th {
    background-color: var(--lx-gray-100);
    font-weight: 600;
}

.lx-post-footer {
    display: flex;
    gap: var(--lx-space-lg);
    flex-wrap: wrap;
    padding-top: var(--lx-space-lg);
    border-top: 1px solid var(--lx-gray-200);
}

.lx-tag {
    display: inline-block;
    background-color: var(--lx-primary-light);
    color: var(--lx-primary-dark);
    padding: 0.25rem 0.75rem;
    border-radius: var(--lx-radius-full);
    font-size: 0.875rem;
    text-decoration: none;
    transition: var(--lx-transition);
    margin: 0.25rem;
}

.lx-tag:hover {
    background-color: var(--lx-primary);
    color: white;
}

/* ========================================
   Sidebar Styles
   ======================================== */
.widget {
    background-color: var(--lx-gray-50);
    padding: var(--lx-space-lg);
    margin-bottom: var(--lx-space-lg);
    border-radius: var(--lx-radius-lg);
}

.widget-title {
    margin: 0 0 1rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--lx-gray-900);
}

.widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget ul li {
    margin-bottom: 0.5rem;
}

.widget ul li a {
    color: var(--lx-primary);
    text-decoration: none;
    transition: var(--lx-transition);
}

.widget ul li a:hover {
    color: var(--lx-primary-hover);
    text-decoration: underline;
}

/* ========================================
   Footer Styles
   ======================================== */
.lx-footer {
    background-color: var(--lx-gray-900);
    color: var(--lx-gray-200);
    padding: var(--lx-space-3xl) 0 var(--lx-space-lg);
    margin-top: auto;
}

.lx-footer-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--lx-space-xl);
    margin-bottom: var(--lx-space-2xl);
}

.lx-footer-col {
    color: var(--lx-gray-300);
}

.lx-footer-col .widget-title {
    color: white;
}

.lx-footer-col .widget {
    background-color: transparent;
    padding: 0;
}

.lx-footer-col a {
    color: var(--lx-gray-400);
}

.lx-footer-col a:hover {
    color: var(--lx-primary);
}

.lx-footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--lx-space-lg);
    border-top: 1px solid var(--lx-gray-700);
    flex-wrap: wrap;
    gap: var(--lx-space-md);
}

.lx-footer-menu {
    display: flex;
    list-style: none;
    gap: var(--lx-space-lg);
    margin: 0;
    padding: 0;
}

.lx-footer-menu a {
    color: var(--lx-gray-400);
}

.lx-footer-menu a:hover {
    color: var(--lx-primary);
}

.lx-copyright p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--lx-gray-400);
}

/* ========================================
   Back to Top Button
   ======================================== */
.lx-back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background-color: var(--lx-primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: var(--lx-transition);
    box-shadow: var(--lx-shadow-lg);
    z-index: 99;
}

.lx-back-to-top.show {
    display: flex;
}

.lx-back-to-top:hover {
    background-color: var(--lx-primary-hover);
    transform: translateY(-3px);
    box-shadow: var(--lx-shadow-lg);
}

.lx-back-to-top:active {
    transform: translateY(-1px);
}

/* ========================================
   响应式设计
   ======================================== */
@media (max-width: 768px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    h4 { font-size: 1.25rem; }
    h5 { font-size: 1.125rem; }
    h6 { font-size: 1rem; }
    
    .lx-container,
    .lx-container-wide {
        padding: 0 var(--lx-space-sm);
    }
    
    /* Header Responsive */
    .lx-header-inner {
        flex-wrap: wrap;
        gap: var(--lx-space-md);
    }
    
    .lx-logo {
        order: 1;
        flex: 1 1 auto;
    }
    
    .lx-menu-toggle {
        display: flex;
        order: 2;
    }
    
    .lx-header-search {
        order: 4;
        width: 100%;
    }
    
    .lx-header-search form {
        width: 100%;
    }
    
    .lx-header-search input[type="search"],
    .lx-header-search input[type="text"] {
        min-width: 100%;
        flex-grow: 1;
    }
    
    /* 移动端菜单隐藏/显示 */
    .lx-nav {
        width: 100%;
        order: 3;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .lx-nav.active {
        max-height: 500px;
    }
    
    .lx-menu {
        flex-direction: column;
        gap: 0;
    }
    
    .lx-menu > li {
        border-bottom: 1px solid var(--lx-gray-200);
    }
    
    .lx-menu ul {
        position: static;
        display: none;
        border: none;
        box-shadow: none;
        background-color: var(--lx-gray-50);
        padding: 0.5rem 1rem;
        margin-left: 1rem;
    }
    
    .lx-menu > li:hover > ul,
    .lx-menu > li.open > ul {
        display: block;
    }
    
    .lx-content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .lx-sidebar {
        grid-column: 1;
    }
    
    .lx-footer-widgets {
        grid-template-columns: 1fr;
    }
    
    .lx-footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

