/*
Theme Name: XHVAL Theme
Theme URI: https://example.com/xhval-theme
Author: Your Name
Author URI: https://example.com
Description: 一个简洁、干净的 WordPress 主题，采用现代设计，适合个人博客和商业网站。
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: xhval-theme
Tags: blog, one-column, two-columns, custom-colors, custom-logo, custom-menu, editor-style, featured-images, footer-widgets, full-width-template, rtl-language-support, theme-options, threaded-comments, translation-ready, wide-blocks
*/

/* ============================================================
   CSS 变量（设计系统）
   ============================================================ */
:root {
    --color-primary: #cc1616;
    --color-primary-dark: #a81010;
    --color-dark: #242933;
    --color-white: #ffffff;
    --color-gray-50: #f9fafb;
    --color-gray-100: #f3f4f6;
    --color-gray-200: #e5e7eb;
    --color-gray-300: #d1d5db;
    --color-gray-400: #9ca3af;
    --color-gray-500: #6b7280;
    --color-gray-600: #4b5563;
    --color-gray-700: #374151;
    --color-gray-800: #1f2937;
    --color-gray-900: #111827;
    --color-slate-50: #f8fafc;
    --color-slate-100: #f1f5f9;
    --color-slate-200: #e2e8f0;
    --color-slate-800: #1e293b;
    --color-slate-900: #0f172a;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-red: 0 10px 15px -3px rgba(204, 22, 22, 0.2);
    --radius-sm: 0.125rem;
    --radius: 0.25rem;
    --radius-lg: 0.5rem;
    --radius-xl: 0.75rem;
    --max-w-7xl: 80rem;
    --max-w-6xl: 72rem;
    --max-w-5xl: 64rem;
    --max-w-4xl: 56rem;
    --max-w-3xl: 48rem;
    --max-w-2xl: 42rem;
}



/* ============================================================
   布局工具类
   ============================================================ */
.container {
    max-width: 1140px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    min-height: 100vh;
}

a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover,
a:focus {
    color: #0056b3;
    text-decoration: underline;
}

a:focus-visible {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul,
ol {
    list-style: none;
}

button,
input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

button {
    cursor: pointer;
}

/* =========================================
   Typography
   ========================================= */
h1 {
    font-size: 2.25rem;
}

h2 {
    font-size: 36px;
    font-style: normal;
    font-weight: 400;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

h5 {
    font-size: 1.125rem;
}

h6 {
    font-size: 1rem;
}

p {
    margin-bottom: 16px;
    font-style: normal;
    font-weight: 400;
    line-height: 1.65em;
}

/* =========================================
   Layout
   ========================================= */
.site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-content {
    flex: 1;

    width: 100%;
    margin: 0 auto;

}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* =========================================
   Header
   ========================================= */
.site-header {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    padding: 0;
    top: 0;
    z-index: 100;
    position: sticky;
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
    gap: 2rem;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Logo */
.header-logo {
    flex-shrink: 0;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-img {
    height: 44px;
    width: auto;
    display: block;
}

/* Navigation - centered */
.main-navigation {
    flex: 1;
    display: flex;
    justify-content: center;
}

.main-navigation .nav-menu {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-navigation li {
    position: relative;
}

.main-navigation a {
    display: block;
    padding: 0.5rem 1rem;
    color: #1a1a2e;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: 0.03em;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.main-navigation a:hover,
.main-navigation .current-menu-item>a {
    color: #2563eb;
}

/* Header actions - search icon */
.header-actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #1a1a2e;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.header-search-btn:hover {
    background-color: #f1f5f9;
    color: #2563eb;
}

/* Search box */
.header-search-box {
    display: none;
    border-top: 1px solid #e9ecef;
    background: #fff;
    padding: 1rem 0;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.header-search-box.active {
    display: block;
    max-height: 80px;
    padding: 1rem 0;
}

.header-search-box .container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.search-form {
    flex: 1;
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-form:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-field {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    color: #1a1a2e;
    outline: none;
}

.search-field::placeholder {
    color: #94a3b8;
}

.search-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    background: #2563eb;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.search-submit:hover {
    background-color: #1d4ed8;
}

.search-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.search-close:hover {
    background-color: #f1f5f9;
    color: #1a1a2e;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    flex-direction: column;
    gap: 5px;
}

.menu-toggle.active .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

.menu-toggle .hamburger-line {
    display: block;
    width: 22px;
    height: 2px;
    background-color: #1a1a2e;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.site-title a {
    color: #1a1a1a;
    text-decoration: none;
}

.site-title a:hover {
    color: #007bff;
}

.site-description {
    font-size: 0.875rem;
    color: #6c757d;
    margin: 0.25rem 0 0;
}

/* =========================================
   Content
   ========================================= */
.content-area {
    display: grid;
    gap: 2rem;
}

.has-sidebar .content-area {
    grid-template-columns: 1fr 300px;
}

.hentry {
    background: #fff;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.entry-title {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
}

.entry-title a {
    color: #1a1a1a;
    text-decoration: none;
}

.entry-title a:hover {
    color: #007bff;
}

.entry-meta {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.entry-meta span+span::before {
    content: " · ";
}

.entry-content {
    line-height: 1.8;
}

.entry-content .wp-image-link {
    display: inline-block;
}

.entry-footer {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

/* =========================================
   Page Templates
   ========================================= */
.page-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.page-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.archive-description {
    color: #6c757d;
    font-size: 1rem;
}

/* =========================================
   Sidebar & Widgets
   ========================================= */
.widget-area {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.widget {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.widget-title {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #007bff;
}

.widget ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.widget li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.widget li:last-child {
    border-bottom: none;
}

/* =========================================
   Comments
   ========================================= */
.comments-area {
    background: #fff;
    border-radius: 8px;
    padding: 2rem;
    margin-top: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.comments-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.comment-list {
    list-style: none;
    margin: 0 0 2rem;
    padding: 0;
}

.comment {
    padding: 1.5rem 0;
    border-bottom: 1px solid #e9ecef;
}

.comment:last-child {
    border-bottom: none;
}

.comment-author {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.comment-metadata {
    font-size: 0.8125rem;
    color: #6c757d;
    margin-bottom: 0.75rem;
}

.comment-content {
    line-height: 1.7;
}

.comment-reply-link {
    font-size: 0.875rem;
    color: #007bff;
}

/* =========================================
   Forms
   ========================================= */
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
input[type="date"],
textarea,
select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: #fff;
    color: #333;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

textarea {
    min-height: 150px;
    resize: vertical;
}

button,
input[type="submit"],
input[type="button"],
.wp-block-button__link {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    text-decoration: none;
}

button:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
.wp-block-button__link:hover {
    background: #0056b3;
    text-decoration: none;
    color: #fff;
}

/* =========================================
   Search Form
   ========================================= */
.search-form {
    display: flex;
    gap: 0.5rem;
}

.search-form .search-field {
    flex: 1;
    padding: 0.625rem 1rem;
}

.search-form .search-submit {
    padding: 0.625rem 1.25rem;
}

/* =========================================
   Pagination
   ========================================= */
.pagination,
.post-navigation,
.nav-links {
    display: flex;
    gap: 0.5rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 0.9375rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.page-numbers:hover {
    background: #e9ecef;
    text-decoration: none;
}

.page-numbers.current,
.page-numbers:hover {
    background: #007bff;
    border-color: #007bff;
    color: #fff;
}

.post-navigation .post-title {
    font-size: 1rem;
    font-weight: 500;
}

.nav-previous,
.nav-next {
    flex: 1;
    min-width: 200px;
}

.nav-previous a,
.nav-next a {
    display: block;
    padding: 1rem;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    text-decoration: none;
    transition: border-color 0.2s ease;
}

.nav-previous a:hover,
.nav-next a:hover {
    border-color: #007bff;
    text-decoration: none;
}

/* =========================================
   Footer
   ========================================= */
.site-footer {
    background: #fff;
    border-top: 1px solid #e9ecef;
    padding: 2rem 0;
    margin-top: 3rem;
    text-align: center;
    font-size: 0.875rem;
    color: #6c757d;
}

.site-footer a {
    color: #6c757d;
}

.site-footer a:hover {
    color: #007bff;
}

/* =========================================
   404 & Error Pages
   ========================================= */
.error-404,
.no-results {
    text-align: center;
    padding: 4rem 2rem;
}

.error-404 .page-title,
.no-results .page-title {
    font-size: 6rem;
    color: #dee2e6;
    margin-bottom: 1rem;
}

/* =========================================
   Alignments
   ========================================= */
.alignleft {
    float: left;
    margin-right: 1.5rem;
    margin-bottom: 1rem;
}

.alignright {
    float: right;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.alignwide {
    max-width: 100%;
    width: 100%;
}

.alignfull {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
}

.wp-caption {
    max-width: 100%;
}

.wp-caption-text {
    font-size: 0.875rem;
    color: #6c757d;
    text-align: center;
    margin-top: 0.5rem;
}

.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background: #f8f9fa;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    clip: auto !important;
    color: #21759b;
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* =========================================
   Blocks
   ========================================= */
.wp-block-image {
    margin: 1.5rem 0;
}

.wp-block-quote {
    border-left: 4px solid #007bff;
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #555;
}

.wp-block-pullquote {
    border-top: 4px solid #007bff;
    border-bottom: 4px solid #007bff;
    padding: 1.5rem;
    margin: 1.5rem 0;
    text-align: center;
    font-style: italic;
    color: #555;
}

.wp-block-code {
    background: #f4f4f4;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.875rem;
}

.wp-block-preformatted {
    background: #f4f4f4;
    padding: 1rem;
    border-radius: 4px;
    overflow-x: auto;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.875rem;
}

.wp-block-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.wp-block-table th,
.wp-block-table td {
    padding: 0.75rem 1rem;
    border: 1px solid #dee2e6;
    text-align: left;
}

.wp-block-table th {
    background: #f8f9fa;
    font-weight: 600;
}

.wp-block-separator {
    border: none;
    border-top: 1px solid #dee2e6;
    margin: 2rem 0;
}

/* =========================================
   Responsive
   ========================================= */
@media (max-width: 768px) {
    .has-sidebar .content-area {
        grid-template-columns: 1fr;
    }

    .header-inner {
        height: 56px;
        padding: 0 1rem;
        gap: 0.5rem;
    }

    .logo-img {
        height: 36px;
    }

    .main-navigation {
        position: relative;
    }

    .main-navigation ul {
        display: none;
        flex-direction: column;
        position: absolute;
        top: calc(100% + 1px);
        left: -1rem;
        right: -1rem;
        background: #fff;
        border: 1px solid #e9ecef;
        padding: 1rem;
        gap: 0;
        z-index: 200;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

    .main-navigation ul.active {
        display: flex;
    }

    .main-navigation a {
        padding: 0.75rem 0.5rem;
        border-bottom: 1px solid #f1f5f9;
    }

    .menu-toggle {
        display: flex;
    }

    .entry-title {
        font-size: 1.5rem;
    }

    .hentry {
        padding: 1.5rem;
    }

    .nav-previous,
    .nav-next {
        min-width: 100%;
    }
}



/* ============================================================
   区块 — Footer 自定义页脚
   ============================================================ */
.home-footer {
    background-color: var(--color-dark);
    color: #9ca3af;
    padding-top: 5rem;
    padding-bottom: 2rem;
}

.home-footer h4 {
    color: var(--color-white);
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-gray-700);
}

.home-footer .footer-logo {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.home-footer .footer-logo-text {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--color-white);
    letter-spacing: -0.05em;
}

.home-footer .footer-logo-accent {
    font-size: 1.5rem;
    font-weight: 900;
    color: #3b82f6;
    letter-spacing: -0.05em;
}

.home-footer .footer-about-text {
    font-size: 0.875rem;
    line-height: 1.625;
    margin-bottom: 1.5rem;
}

.home-footer ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.home-footer ul li {
    padding: 0.25rem 0;
}

.home-footer ul li a {
    font-size: 0.875rem;
    color: #9ca3af;
    transition: color 0.2s ease;
}

.home-footer ul li a:hover {
    color: var(--color-white);
    text-decoration: none;
}

.home-footer .footer-contact p {
    font-size: 0.875rem;
    line-height: 1.75;
}

.home-footer .footer-copyright {
    border-top: 1px solid var(--color-gray-700);
    padding-top: 2rem;
    margin-top: 4rem;
    display: flex;
    flex-direction: column;
    md-flex-direction: row;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}

.home-footer .footer-copyright p {
    margin: 0;
}

.home-footer .footer-social {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.home-footer .footer-social-btn {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background-color: var(--color-gray-800);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.home-footer .footer-social-btn:hover {
    background-color: var(--color-primary);
    color: var(--color-white);
}