/*
Theme Name: Qing
Theme URI: https://example.com/qing
Author: Qing Theme
Author URI: https://example.com
Description: A clean and elegant WordPress theme with modern design. 清 - 简洁优雅的WordPress主题。
Version: 1.0.0
Requires at least: 5.0
Tested up to: 6.5
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: qing
Tags: blog, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* === Reset & Base === */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
    line-height: 1.7;
    color: #333;
    background-color: #ffffff !important;
}

a {
    color: #2563eb;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #1d4ed8;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* === Layout === */
.site-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.content-area {
    display: flex;
    gap: 40px;
    padding: 40px 0;
}

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

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

/* === Header === */
.site-header {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
}

.site-branding {
    flex-shrink: 0;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}

.site-title a {
    color: #111;
    text-decoration: none;
}

.site-title a:hover {
    color: #2563eb;
}

.site-description {
    font-size: 0.85rem;
    color: #6b7280;
    margin-top: 2px;
}

/* === Navigation === */
.main-navigation ul {
    display: flex;
    list-style: none;
    gap: 8px;
}

.main-navigation li {
    position: relative;
}

.main-navigation a {
    display: block;
    padding: 8px 16px;
    color: #374151;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a {
    color: #2563eb;
    background: #eff6ff;
}

/* Sub-menu */
.main-navigation ul ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    min-width: 200px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 8px 0;
    flex-direction: column;
    gap: 0;
    z-index: 10;
}

.main-navigation li:hover > ul {
    display: flex;
}

.main-navigation ul ul a {
    padding: 8px 16px;
    border-radius: 0;
}

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #374151;
}

/* === Posts === */
.post-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease;
}

.post-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.post-card .post-thumbnail {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.post-card .post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-card:hover .post-thumbnail img {
    transform: scale(1.03);
}

.post-card .post-content-wrap {
    padding: 24px;
}

.post-card .entry-title {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 10px;
}

.post-card .entry-title a {
    color: #111;
}

.post-card .entry-title a:hover {
    color: #2563eb;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 12px;
}

.post-meta a {
    color: #6b7280;
}

.post-meta a:hover {
    color: #2563eb;
}

.entry-summary p,
.entry-content p {
    margin-bottom: 1em;
    line-height: 1.8;
}

.read-more {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 20px;
    background: #2563eb;
    color: #fff;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s ease;
}

.read-more:hover {
    background: #1d4ed8;
    color: #fff;
}

/* === Single Post / Page === */
.single-post-wrap,
.page-wrap {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.single-post-wrap .entry-title,
.page-wrap .entry-title {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 16px;
    color: #111;
}

.single-post-wrap .entry-content,
.page-wrap .entry-content {
    font-size: 1.05rem;
    line-height: 1.9;
}

.entry-content h2 {
    font-size: 1.5rem;
    margin: 2em 0 0.8em;
    padding-bottom: 0.3em;
    border-bottom: 2px solid #e5e7eb;
}

.entry-content h3 {
    font-size: 1.25rem;
    margin: 1.5em 0 0.6em;
}

.entry-content ul,
.entry-content ol {
    margin: 1em 0;
    padding-left: 1.5em;
}

.entry-content blockquote {
    border-left: 4px solid #2563eb;
    padding: 16px 24px;
    margin: 1.5em 0;
    background: #f8fafc;
    border-radius: 0 8px 8px 0;
    color: #4b5563;
}

.entry-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5em 0;
}

.entry-content code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

.entry-content pre code {
    background: none;
    padding: 0;
}

.post-tags {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.post-tags a {
    display: inline-block;
    padding: 4px 12px;
    background: #f1f5f9;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #475569;
    margin: 4px 4px 4px 0;
}

.post-tags a:hover {
    background: #2563eb;
    color: #fff;
}

/* === Post Navigation === */
.post-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    gap: 20px;
}

.post-navigation .nav-previous,
.post-navigation .nav-next {
    flex: 1;
}

.post-navigation a {
    display: block;
    padding: 16px 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s;
}

.post-navigation a:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.post-navigation .nav-label {
    font-size: 0.8rem;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.post-navigation .nav-title {
    color: #111;
    font-weight: 600;
    margin-top: 4px;
}

.post-navigation .nav-next {
    text-align: right;
}

/* === Sidebar === */
.sidebar .widget {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.sidebar .widget-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
    color: #111;
}

.sidebar .widget ul {
    list-style: none;
}

.sidebar .widget ul li {
    padding: 6px 0;
    border-bottom: 1px solid #f3f4f6;
}

.sidebar .widget ul li:last-child {
    border-bottom: none;
}

.sidebar .widget ul li a {
    color: #374151;
    font-size: 0.95rem;
}

.sidebar .widget ul li a:hover {
    color: #2563eb;
}

/* === Comments === */
.comments-area {
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    margin-top: 30px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.comments-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 24px;
}

.comment-list {
    list-style: none;
}

.comment-list .comment {
    padding: 20px 0;
    border-bottom: 1px solid #f3f4f6;
}

.comment-list .comment:last-child {
    border-bottom: none;
}

.comment-author {
    font-weight: 600;
    margin-bottom: 4px;
}

.comment-author img {
    border-radius: 50%;
    margin-right: 10px;
    vertical-align: middle;
}

.comment-meta {
    font-size: 0.85rem;
    color: #9ca3af;
    margin-bottom: 8px;
}

.comment-content p {
    margin-bottom: 0.5em;
}

.comment-reply-link {
    font-size: 0.85rem;
    color: #2563eb;
}

.comment-respond {
    margin-top: 30px;
}

.comment-respond .comment-reply-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.comment-form label {
    display: block;
    font-weight: 500;
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95rem;
    margin-bottom: 16px;
    transition: border-color 0.2s;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.comment-form .submit {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.comment-form .submit:hover {
    background: #1d4ed8;
}

/* === Pagination === */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 40px;
}

.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #374151;
    transition: all 0.2s;
}

.pagination .page-numbers:hover {
    border-color: #2563eb;
    color: #2563eb;
}

.pagination .page-numbers.current {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

/* === Footer === */
.site-footer {
    background: #1e293b;
    color: #94a3b8;
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-widgets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 30px;
}

.footer-widgets .widget-title {
    color: #e2e8f0;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.footer-widgets ul {
    list-style: none;
}

.footer-widgets ul li {
    padding: 4px 0;
}

.footer-widgets ul li a {
    color: #94a3b8;
    font-size: 0.9rem;
}

.footer-widgets ul li a:hover {
    color: #fff;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #334155;
    font-size: 0.85rem;
}

/* === Archive / Category Header === */
.archive-header {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.archive-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111;
}

.archive-description {
    margin-top: 8px;
    color: #6b7280;
}

/* === Search === */
.search-form {
    display: flex;
    gap: 8px;
}

.search-form .search-field {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95rem;
}

.search-form .search-field:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-form .search-submit {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.search-form .search-submit:hover {
    background: #1d4ed8;
}

/* === 404 === */
.error-404 {
    text-align: center;
    padding: 80px 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.error-404 .error-code {
    font-size: 6rem;
    font-weight: 800;
    color: #e5e7eb;
    line-height: 1;
}

.error-404 .error-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 16px 0 10px;
    color: #111;
}

.error-404 .error-message {
    color: #6b7280;
    margin-bottom: 30px;
}

/* === Featured Image (Single) === */
.single-featured-image {
    margin-bottom: 24px;
    border-radius: 12px;
    overflow: hidden;
}

.single-featured-image img {
    width: 100%;
    height: auto;
}

/* === Screen Reader Text === */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;
}

/* === Responsive === */
@media (max-width: 768px) {
    .content-area {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .header-inner {
        flex-wrap: wrap;
    }

    .menu-toggle {
        display: block;
    }

    .main-navigation ul {
        display: none;
        flex-direction: column;
        width: 100%;
        padding-top: 12px;
    }

    .main-navigation.toggled ul {
        display: flex;
    }

    .main-navigation ul ul {
        position: static;
        box-shadow: none;
        padding-left: 16px;
    }

    .single-post-wrap,
    .page-wrap {
        padding: 24px;
    }

    .single-post-wrap .entry-title,
    .page-wrap .entry-title {
        font-size: 1.5rem;
    }

    .footer-widgets {
        grid-template-columns: 1fr;
    }

    .post-navigation {
        flex-direction: column;
    }
}
