/* ===================================================
   WordPress Twenty Twenty-Four Inspired Style
   软件应用中心网
   =================================================== */

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

:root {
    --wp-blue: #3858e9;
    --wp-blue-hover: #2241b8;
    --wp-blue-light: #e8ecfb;
    --wp-dark: #1d2327;
    --wp-gray-900: #2c3338;
    --wp-gray-700: #50575e;
    --wp-gray-500: #757575;
    --wp-gray-300: #c3c4c7;
    --wp-gray-200: #dcdcde;
    --wp-gray-100: #f0f0f1;
    --wp-bg: #f6f7f7;
    --wp-white: #ffffff;
    --wp-green: #00a32a;
    --wp-red: #d63638;
    --wp-orange: #dba617;
    --wp-font-heading: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    --wp-font-body: 'Georgia', 'Times New Roman', serif;
    --wp-shadow: 0 1px 3px rgba(0,0,0,.08);
    --wp-shadow-md: 0 2px 8px rgba(0,0,0,.1);
    --wp-shadow-lg: 0 4px 16px rgba(0,0,0,.12);
    --wp-radius: 4px;
    --wp-radius-lg: 8px;
    --wp-max-width: 1280px;
    --wp-content-width: 780px;
    --wp-sidebar-width: 300px;
    --wp-header-height: 46px;
}

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

body {
    font-family: var(--wp-font-body);
    color: var(--wp-gray-900);
    background: var(--wp-bg);
    line-height: 1.75;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--wp-blue); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--wp-blue-hover); }
a:focus-visible { outline: 2px solid var(--wp-blue); outline-offset: 2px; }

img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

/* ---------- Typography ---------- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--wp-font-heading);
    font-weight: 600;
    line-height: 1.3;
    color: var(--wp-dark);
}

/* ---------- Header (WordPress Admin Bar Style) ---------- */
.site-header {
    background: var(--wp-dark);
    color: var(--wp-gray-300);
    height: var(--wp-header-height);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0,0,0,.15);
}

.header-inner {
    max-width: var(--wp-max-width);
    margin: 0 auto;
    padding: 0 16px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 0;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--wp-white);
    font-family: var(--wp-font-heading);
    font-size: 14px;
    font-weight: 600;
    padding: 0 12px;
    height: 100%;
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: -0.2px;
}

.site-logo:hover { color: var(--wp-white); }
.site-logo svg { flex-shrink: 0; }

.main-nav {
    display: flex;
    gap: 0;
    margin-left: 16px;
    height: 100%;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0 14px;
    height: 100%;
    font-family: var(--wp-font-heading);
    font-size: 13px;
    font-weight: 500;
    color: var(--wp-gray-300);
    text-decoration: none;
    transition: all .15s ease;
    border-bottom: 2px solid transparent;
}

.nav-link:hover, .nav-link.active {
    color: var(--wp-white);
    background: rgba(255,255,255,.08);
    border-bottom-color: var(--wp-blue);
}

.search-form {
    display: flex;
    align-items: center;
    margin-left: auto;
    background: rgba(255,255,255,.08);
    border-radius: 3px;
    overflow: hidden;
    transition: background .2s;
    max-width: 240px;
}

.search-form:focus-within { background: rgba(255,255,255,.15); }

.search-form input {
    width: 160px;
    padding: 5px 10px;
    border: none;
    background: transparent;
    font-size: 13px;
    color: var(--wp-white);
    outline: none;
    font-family: var(--wp-font-heading);
}

.search-form input::placeholder { color: var(--wp-gray-500); }

.search-form button {
    padding: 5px 10px;
    border: none;
    background: transparent;
    color: var(--wp-gray-500);
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: color .15s;
}

.search-form button:hover { color: var(--wp-white); }

.menu-toggle {
    display: none;
    padding: 8px;
    border: none;
    background: transparent;
    color: var(--wp-gray-300);
    cursor: pointer;
}

/* ---------- Breadcrumb ---------- */
.breadcrumb {
    max-width: var(--wp-max-width);
    margin: 0 auto;
    padding: 10px 16px;
    font-family: var(--wp-font-heading);
    font-size: 12px;
    color: var(--wp-gray-500);
}

.breadcrumb a { color: var(--wp-blue); font-size: 12px; }
.breadcrumb a:hover { color: var(--wp-blue-hover); }
.bc-sep { margin: 0 6px; color: var(--wp-gray-300); }

/* ---------- Layout ---------- */
.main-layout {
    max-width: var(--wp-max-width);
    margin: 0 auto;
    padding: 0 16px;
    display: grid;
    grid-template-columns: 1fr var(--wp-sidebar-width);
    gap: 24px;
    align-items: start;
    flex: 1;
}

.content-area { min-width: 0; }
.sidebar-area { position: sticky; top: calc(var(--wp-header-height) + 16px); }

/* ---------- Article Cards (WordPress Post List Style) ---------- */
.article-feed {
    display: flex;
    flex-direction: column;
    background: var(--wp-white);
    border-radius: var(--wp-radius);
    box-shadow: var(--wp-shadow);
    overflow: hidden;
}

.article-card {
    padding: 24px 28px;
    border-bottom: 1px solid var(--wp-gray-200);
    transition: background .15s;
}

.article-card:hover { background: var(--wp-gray-100); }
.article-card:last-child { border-bottom: none; }

.article-card-title {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 10px;
    font-family: var(--wp-font-heading);
    letter-spacing: -0.3px;
}

.article-card-title a { color: var(--wp-dark); }
.article-card-title a:hover { color: var(--wp-blue); }

.article-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-family: var(--wp-font-heading);
    font-size: 13px;
    color: var(--wp-gray-500);
    margin-bottom: 12px;
    align-items: center;
}

.article-card-meta time { font-style: normal; }

.article-card-excerpt {
    font-size: 15px;
    line-height: 1.8;
    color: var(--wp-gray-700);
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card-tags { display: flex; flex-wrap: wrap; gap: 6px; }

.tag {
    display: inline-block;
    padding: 3px 10px;
    background: var(--wp-blue-light);
    color: var(--wp-blue);
    border-radius: 3px;
    font-family: var(--wp-font-heading);
    font-size: 12px;
    font-weight: 500;
    transition: all .15s;
}

.tag:hover { background: var(--wp-blue); color: var(--wp-white); }

/* ---------- Category / Search Heading ---------- */
.category-heading, .search-heading {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 3px solid var(--wp-blue);
    font-family: var(--wp-font-heading);
    letter-spacing: -0.5px;
}

.result-count {
    font-size: 14px;
    font-weight: 400;
    color: var(--wp-gray-500);
    margin-left: 8px;
}

/* ---------- Sidebar (WordPress Widget Style) ---------- */
.sidebar-section {
    background: var(--wp-white);
    border-radius: var(--wp-radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--wp-shadow);
}

.sidebar-title {
    font-size: 14px;
    font-weight: 600;
    font-family: var(--wp-font-heading);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--wp-dark);
    padding-bottom: 12px;
    margin-bottom: 14px;
    border-bottom: 2px solid var(--wp-blue);
    line-height: 1.2;
}

.side-article-list { max-height: 420px; overflow-y: auto; }

.side-article-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--wp-gray-100);
}

.side-article-item:last-child { border-bottom: none; }

.side-article-title {
    display: block;
    font-size: 14px;
    font-weight: 500;
    font-family: var(--wp-font-heading);
    line-height: 1.45;
    color: var(--wp-gray-900);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.side-article-title:hover { color: var(--wp-blue); }

.side-article-meta {
    font-family: var(--wp-font-heading);
    font-size: 12px;
    color: var(--wp-gray-500);
}

/* Category Navigation */
.category-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }

.category-nav a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: var(--wp-radius);
    font-family: var(--wp-font-heading);
    font-size: 13px;
    color: var(--wp-gray-700);
    transition: all .15s;
}

.category-nav a:hover {
    background: var(--wp-blue-light);
    color: var(--wp-blue);
}

.cat-icon { font-size: 15px; flex-shrink: 0; }

/* ---------- Article Detail Page (WordPress Single Post) ---------- */
.article-page {
    background: var(--wp-white);
    border-radius: var(--wp-radius);
    padding: 32px 36px;
    box-shadow: var(--wp-shadow);
}

.article-page-header { margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--wp-gray-200); }

.article-page-header h1 {
    font-size: 30px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 14px;
    font-family: var(--wp-font-heading);
    letter-spacing: -0.5px;
    color: var(--wp-dark);
}

.article-page-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-family: var(--wp-font-heading);
    font-size: 13px;
    color: var(--wp-gray-500);
}

.article-page-meta a { color: var(--wp-blue); }

/* Article Content - WordPress Editor Style */
.article-page-content {
    font-size: 16px;
    line-height: 1.85;
    color: var(--wp-gray-900);
    font-family: var(--wp-font-body);
}

.article-page-content p { margin-bottom: 1.2em; }

.article-page-content h2 {
    font-size: 24px;
    margin: 2em 0 0.8em;
    padding-bottom: 0.5em;
    border-bottom: 1px solid var(--wp-gray-200);
    font-family: var(--wp-font-heading);
    font-weight: 600;
}

.article-page-content h3 {
    font-size: 20px;
    margin: 1.8em 0 0.6em;
    font-family: var(--wp-font-heading);
    font-weight: 600;
}

.article-page-content a { color: var(--wp-blue); text-decoration: underline; text-underline-offset: 2px; }
.article-page-content a:hover { color: var(--wp-blue-hover); }

.article-page-content ul, .article-page-content ol {
    margin: 1em 0 1em 2em;
}

.article-page-content li {
    margin-bottom: 0.4em;
    line-height: 1.7;
}

.article-page-content ul li { list-style: disc; }
.article-page-content ol li { list-style: decimal; }

.article-page-content blockquote {
    border-left: 4px solid var(--wp-blue);
    padding: 16px 20px;
    margin: 1.5em 0;
    background: var(--wp-blue-light);
    border-radius: 0 var(--wp-radius) var(--wp-radius) 0;
    font-style: italic;
    color: var(--wp-gray-700);
}

.article-page-content img {
    border-radius: var(--wp-radius);
    margin: 1.5em 0;
    box-shadow: var(--wp-shadow-md);
}

.article-page-content pre {
    background: var(--wp-dark);
    color: #abb2bf;
    padding: 20px;
    border-radius: var(--wp-radius);
    overflow-x: auto;
    font-size: 14px;
    line-height: 1.6;
    margin: 1.5em 0;
    font-family: 'Fira Code', 'Consolas', monospace;
}

.article-page-content code {
    background: var(--wp-gray-100);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 14px;
    font-family: 'Fira Code', 'Consolas', monospace;
    color: var(--wp-red);
}

.article-page-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.article-page-content hr {
    border: none;
    border-top: 1px solid var(--wp-gray-200);
    margin: 2em 0;
}

/* Article Footer */
.article-page-footer {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--wp-gray-200);
    font-family: var(--wp-font-heading);
    font-size: 13px;
}

.article-page-footer strong {
    color: var(--wp-gray-700);
    font-weight: 600;
    margin-right: 8px;
}

.article-page-footer .tag { margin: 4px 4px 0 0; }

/* ---------- Pagination (WordPress Style) ---------- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin: 28px 0;
    padding: 20px 0;
    font-family: var(--wp-font-heading);
}

.pagination-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--wp-gray-300);
    border-radius: var(--wp-radius);
    background: var(--wp-white);
    color: var(--wp-gray-700);
    font-size: 14px;
    font-weight: 500;
    transition: all .15s;
    text-decoration: none;
}

.pagination-btn:hover {
    background: var(--wp-blue);
    color: var(--wp-white);
    border-color: var(--wp-blue);
}

.pagination-btn.active {
    background: var(--wp-dark);
    color: var(--wp-white);
    border-color: var(--wp-dark);
}

/* ---------- Footer (WordPress Style) ---------- */
.site-footer {
    background: var(--wp-dark);
    color: var(--wp-gray-500);
    margin-top: auto;
    padding: 28px 0;
    font-family: var(--wp-font-heading);
    font-size: 13px;
}

.footer-inner {
    max-width: var(--wp-max-width);
    margin: 0 auto;
    padding: 0 16px;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 12px;
}

.footer-links a { color: var(--wp-gray-300); font-size: 13px; }
.footer-links a:hover { color: var(--wp-white); }

.footer-copyright { color: var(--wp-gray-500); font-size: 13px; margin-bottom: 4px; }
.footer-note { color: var(--wp-gray-500); font-size: 12px; opacity: 0.7; }

/* ---------- Empty State ---------- */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--wp-gray-500);
    font-family: var(--wp-font-heading);
}

.empty-state p { font-size: 16px; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .main-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .sidebar-area { position: static; }
}

@media (max-width: 768px) {
    :root { --wp-header-height: 48px; }

    .header-inner { gap: 0; }

    .site-logo span { display: none; }
    .site-logo { padding: 0 8px; }

    .main-nav {
        display: none;
        position: absolute;
        top: var(--wp-header-height);
        left: 0;
        right: 0;
        background: var(--wp-dark);
        flex-direction: column;
        padding: 8px 0;
        box-shadow: var(--wp-shadow-lg);
        height: auto;
        margin-left: 0;
    }

    .main-nav.show { display: flex; }

    .nav-link {
        height: auto;
        padding: 10px 16px;
        border-bottom: none;
        border-left: 3px solid transparent;
    }

    .nav-link:hover, .nav-link.active {
        border-bottom: none;
        border-left-color: var(--wp-blue);
    }

    .menu-toggle { display: flex; align-items: center; justify-content: center; margin-left: auto; }

    .search-form {
        max-width: 140px;
    }

    .search-form input { width: 100px; }

    .article-card { padding: 20px; }
    .article-card-title { font-size: 19px; }

    .article-page { padding: 20px; }
    .article-page-header h1 { font-size: 24px; }
    .article-page-content { font-size: 15px; }

    .category-heading, .search-heading { font-size: 22px; }
    .category-nav { grid-template-columns: 1fr; }

    .footer-links { flex-wrap: wrap; gap: 12px; }
}

@media (max-width: 480px) {
    :root { --wp-header-height: 44px; }
    html { font-size: 14px; }

    .search-form { max-width: 100px; }
    .search-form input { width: 70px; }

    .header-inner { gap: 4px; }
    .main-nav { margin-left: 0; }

    .article-card { padding: 16px; }
    .article-card-title { font-size: 17px; }
    .article-card-excerpt { -webkit-line-clamp: 2; }
}

/* ---------- Print ---------- */
@media print {
    .site-header, .site-footer, .sidebar-area, .pagination, .article-page-footer, .breadcrumb,
    .search-form, .menu-toggle { display: none !important; }
    .main-layout { display: block; }
    .article-page { box-shadow: none; padding: 0; }
    body { background: #fff; color: #000; }
    a { color: #000; text-decoration: underline; }
}

/* ---------- Accessibility ---------- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--wp-gray-300); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--wp-gray-500); }

/* ---------- Animations ---------- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.article-card { animation: fadeIn 0.2s ease-out; }
