/*
Theme Name: Press
Theme URI: https://example.com/press
Author: Your Name
Author URI: https://example.com
Description: 一个现代化、响应式的 WordPress 主题，适用于博客、企业网站和作品展示。
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: press
Tags: blog, one-column, two-columns, right-sidebar, custom-header, custom-menu, featured-images, threaded-comments, translation-ready

This theme, like WordPress, is licensed under the GPL.
Use it to make something cool, have fun, and share what you've learned with others.
*/

/* ========================================
   CSS 变量 & 全局样式
   ======================================== */

:root {
    --color-primary: #2563eb;
    --color-primary-dark: #1d4ed8;
    --color-primary-light: #dbeafe;
    --color-secondary: #64748b;
    --color-accent: #f59e0b;
    --color-text: #1e293b;
    --color-text-light: #64748b;
    --color-text-lighter: #94a3b8;
    --color-bg: #ffffff;
    --color-bg-alt: #f8fafc;
    --color-bg-dark: #f1f5f9;
    --color-border: #e2e8f0;
    --color-success: #10b981;
    --color-error: #ef4444;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", monospace;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --content-width: 1200px;
    --sidebar-width: 320px;
    --header-height: 72px;
    --transition: 0.2s ease-in-out;
}

/* ========================================
   Reset & Base
   ======================================== */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.75;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   Typography
   ======================================== */

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-text);
    margin-bottom: 0.75rem;
}

h1 { font-size: 2.25rem; letter-spacing: -0.025em; }
h2 { font-size: 1.875rem; letter-spacing: -0.02em; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
    margin-bottom: 1.25rem;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--color-primary-dark);
}

blockquote {
    border-left: 4px solid var(--color-primary);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: var(--color-bg-alt);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-style: italic;
    color: var(--color-secondary);
}

blockquote cite {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    font-style: normal;
    color: var(--color-text-lighter);
}

code, pre {
    font-family: var(--font-mono);
    font-size: 0.875rem;
}

code {
    background: var(--color-bg-dark);
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
}

pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1.25rem;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin: 1.5rem 0;
}

pre code {
    background: none;
    padding: 0;
    color: inherit;
}

ul, ol {
    margin: 0 0 1.25rem 1.5rem;
}

li {
    margin-bottom: 0.5rem;
}

img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
}

hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 2rem 0;
}

/* ========================================
   Layout
   ======================================== */

.container {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.site-content {
    padding: 2.5rem 0;
    min-height: calc(100vh - var(--header-height) - 200px);
}

.content-area {
    width: 100%;
}

.has-sidebar .site-main {
    display: flex;
    gap: 2.5rem;
}

.has-sidebar .content-area {
    flex: 1;
    min-width: 0;
}

.has-sidebar .widget-area {
    width: var(--sidebar-width);
    flex-shrink: 0;
}

/* ========================================
   Header
   ======================================== */

.site-header {
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.92);
}

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

.site-branding {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.025em;
}

.site-title a {
    color: var(--color-text);
}

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

.site-description {
    font-size: 0.875rem;
    color: var(--color-text-light);
    margin: 0;
}

/* Navigation */
.main-navigation {
    display: flex;
    align-items: center;
}

.main-navigation ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.25rem;
}

.main-navigation li {
    margin: 0;
    position: relative;
}

.main-navigation a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--color-secondary);
    font-weight: 500;
    font-size: 0.9375rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a {
    color: var(--color-primary);
    background: var(--color-primary-light);
}

/* Sub-menus */
.main-navigation .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    min-width: 200px;
    flex-direction: column;
    z-index: 200;
}

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

.main-navigation .sub-menu a {
    padding: 0.5rem 0.75rem;
    white-space: nowrap;
}

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--color-text);
}

.menu-toggle .bar {
    display: block;
    width: 24px;
    height: 2px;
    background: currentColor;
    margin: 5px 0;
    transition: var(--transition);
}

/* ========================================
   Posts / Articles
   ======================================== */

.entry-header {
    margin-bottom: 1.5rem;
}

.entry-title {
    font-size: 1.875rem;
    margin-bottom: 0.75rem;
}

.entry-title a {
    color: var(--color-text);
}

.entry-title a:hover {
    color: var(--color-primary);
}

.entry-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--color-text-light);
}

.entry-meta span {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.entry-meta a {
    color: var(--color-secondary);
}

.entry-meta a:hover {
    color: var(--color-primary);
}

.entry-content {
    font-size: 1.0625rem;
    line-height: 1.8;
}

.entry-content > *:first-child {
    margin-top: 0;
}

.entry-content > *:last-child {
    margin-bottom: 0;
}

.entry-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--color-text-light);
    align-items: center;
}

/* Article Card (archive/blog list) */
.post-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: box-shadow var(--transition), transform var(--transition);
    margin-bottom: 2rem;
}

.post-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.post-card .post-thumbnail {
    overflow: hidden;
}

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

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

.post-card .card-body {
    padding: 1.5rem;
}

.post-card .entry-title {
    font-size: 1.375rem;
    margin-bottom: 0.5rem;
}

.post-card .entry-meta {
    margin-bottom: 1rem;
}

.post-card .read-more {
    display: inline-block;
    font-weight: 600;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Sticky Post */
.sticky .post-card {
    border-color: var(--color-primary);
    border-width: 2px;
    background: var(--color-primary-light);
}

/* ========================================
   Pagination
   ======================================== */

.nav-links {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2.5rem;
}

.page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-secondary);
    transition: all var(--transition);
}

.page-numbers.current {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.page-numbers:hover:not(.current) {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* Post Navigation (prev/next) */
.post-navigation {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
}

.post-navigation .nav-links {
    justify-content: space-between;
}

.post-navigation .nav-previous a,
.post-navigation .nav-next a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

/* ========================================
   Sidebar / Widgets
   ======================================== */

.widget-area {
    font-size: 0.9375rem;
}

.widget {
    background: var(--color-bg-alt);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.widget-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--color-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.widget li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-border);
    margin: 0;
}

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

.widget li:first-child {
    padding-top: 0;
}

.widget a {
    color: var(--color-secondary);
    transition: color var(--transition);
}

.widget a:hover {
    color: var(--color-primary);
}

/* Widget: Search */
.widget_search .search-form {
    display: flex;
}

.widget_search .search-field {
    flex: 1;
    padding: 0.625rem 1rem;
    border: 1px solid var(--color-border);
    border-right: none;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    font-size: 0.9375rem;
    outline: none;
    transition: border-color var(--transition);
}

.widget_search .search-field:focus {
    border-color: var(--color-primary);
}

.widget_search .search-submit {
    padding: 0.625rem 1.25rem;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    cursor: pointer;
    font-size: 0.9375rem;
    font-weight: 600;
    transition: background var(--transition);
}

.widget_search .search-submit:hover {
    background: var(--color-primary-dark);
}

/* Widget: Tag Cloud */
.tagcloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-cloud-link {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 9999px;
    font-size: 0.8125rem !important;
    color: var(--color-secondary);
    transition: all var(--transition);
}

.tag-cloud-link:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

/* ========================================
   Footer
   ======================================== */

.site-footer {
    background: var(--color-bg-alt);
    border-top: 1px solid var(--color-border);
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--color-text-light);
}

.footer-inner a {
    color: var(--color-secondary);
}

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

/* ========================================
   Comments
   ======================================== */

.comments-area {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
}

.comments-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

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

.comment-list .children {
    list-style: none;
    margin: 0 0 0 2.5rem;
    padding: 0;
}

.comment {
    margin-bottom: 1.5rem;
}

.comment-body {
    padding: 1.5rem;
    background: var(--color-bg-alt);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
}

.comment-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}

.comment-author {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comment-author .avatar {
    border-radius: 50%;
    width: 40px;
    height: 40px;
}

.comment-metadata a {
    color: var(--color-text-lighter);
}

.comment-content {
    font-size: 0.9375rem;
}

.comment-content p:last-child {
    margin-bottom: 0;
}

.reply {
    margin-top: 0.75rem;
}

.comment-reply-link {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-primary);
}

/* Comment Form */
.comment-respond {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--color-bg-alt);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
}

.comment-reply-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.comment-form label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.375rem;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-family: var(--font-sans);
    outline: none;
    transition: border-color var(--transition);
    margin-bottom: 1rem;
}

.comment-form input:focus,
.comment-form textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

.comment-form .submit {
    padding: 0.75rem 1.5rem;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
}

.comment-form .submit:hover {
    background: var(--color-primary-dark);
}

.form-submit {
    margin-bottom: 0;
}

/* ========================================
   Buttons
   ======================================== */

.button,
button,
input[type="button"],
input[type="reset"],
input[type="submit"] {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.5;
}

.button:hover,
button:hover,
input[type="button"]:hover,
input[type="reset"]:hover,
input[type="submit"]:hover {
    background: var(--color-primary-dark);
    color: #fff;
}

.button--outline {
    background: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.button--outline:hover {
    background: var(--color-primary);
    color: #fff;
}

.button--sm {
    font-size: 0.8125rem;
    padding: 0.375rem 0.875rem;
}

.button--lg {
    font-size: 1.0625rem;
    padding: 0.875rem 2rem;
}

/* ========================================
   404 Page
   ======================================== */

.error-404 {
    text-align: center;
    padding: 4rem 0;
}

.error-404 .page-title {
    font-size: 8rem;
    font-weight: 900;
    color: var(--color-primary-light);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.error-404 .subtitle {
    font-size: 1.5rem;
    color: var(--color-secondary);
    margin-bottom: 1.5rem;
}

.error-404 .search-form {
    max-width: 480px;
    margin: 0 auto;
    display: flex;
}

.error-404 .search-field {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-right: none;
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    font-size: 1rem;
    outline: none;
}

.error-404 .search-field:focus {
    border-color: var(--color-primary);
}

.error-404 .search-submit {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* ========================================
   Page Header (Archive/Search)
   ======================================== */

.page-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.page-header .page-title {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.archive-description {
    font-size: 1rem;
    color: var(--color-text-light);
}

/* ========================================
   Utilities
   ======================================== */

.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;
    width: 1px;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background: var(--color-bg);
    clip: auto !important;
    clip-path: none;
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    height: auto;
    left: 1rem;
    line-height: normal;
    padding: 1rem;
    text-decoration: none;
    top: 1rem;
    width: auto;
    z-index: 100000;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

.alignleft { float: left; margin: 0 1.5rem 1rem 0; }
.alignright { float: right; margin: 0 0 1rem 1.5rem; }
.aligncenter { display: block; margin: 0 auto 1.5rem; }

.wp-caption {
    max-width: 100%;
    margin-bottom: 1.5rem;
}

.wp-caption-text {
    font-size: 0.8125rem;
    color: var(--color-text-light);
    text-align: center;
    margin-top: 0.5rem;
}

.bypostauthor {
    /* Highlight post author comments */
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 1024px) {
    .has-sidebar .site-main {
        flex-direction: column;
    }

    .has-sidebar .widget-area {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .main-navigation ul {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        background: var(--color-bg);
        border-bottom: 1px solid var(--color-border);
        padding: 1rem;
        flex-direction: column;
        box-shadow: var(--shadow-lg);
    }

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

    .main-navigation .sub-menu {
        position: static;
        box-shadow: none;
        border: none;
        padding-left: 1rem;
    }

    .site-title {
        font-size: 1.25rem;
    }

    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }

    .entry-title {
        font-size: 1.5rem;
    }

    .post-card .post-thumbnail img {
        height: 200px;
    }

    .footer-inner {
        flex-direction: column;
        text-align: center;
    }

    .comment-list .children {
        margin-left: 1.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .entry-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .post-card .card-body {
        padding: 1.25rem;
    }

    .error-404 .page-title {
        font-size: 5rem;
    }
}

/* ========================================
   Print
   ======================================== */

@media print {
    .site-header,
    .site-footer,
    .widget-area,
    .comments-area,
    .menu-toggle {
        display: none;
    }

    body {
        font-size: 12pt;
        line-height: 1.6;
        color: #000;
    }

    a {
        color: #000;
        text-decoration: underline;
    }
}
