/*
Theme Name: CodePaks
Theme URI: https://codepaks.com
Author: CodePaks Core Team
Author URI: https://codepaks.com
Description: High-performance, GEO/AEO/SEO optimized digital source code & tech asset marketplace theme built for WooCommerce.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 6.7
Requires PHP: 8.3
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: codepaks
Tags: e-commerce, dark, custom-colors, full-width-template, translation-ready

CodePaks WordPress Theme, (C) 2026 CodePaks Team.
CodePaks is distributed under the terms of the GNU GPL.
*/

/* ==========================================================================
   WordPress Core Accessibility & Layout Standards (A11y & Base Helpers)
   这些是 WordPress 官方标准强制要求的底层无障碍类与对齐类，
   确保屏幕阅读器无障碍（A11y）以及 Google 蜘蛛对隐藏文本的合规解析。
   ========================================================================== */

/* 屏幕阅读器专用文本（隐藏在可视区外，但保留给爬虫与残障读屏软件） */
.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;
}

.screen-reader-text:focus {
    background-color: #0f172a;
    border-radius: 6px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    clip-path: none;
    color: #38bdf8;
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    height: auto;
    left: 1rem;
    line-height: normal;
    padding: 1rem 1.5rem;
    text-decoration: none;
    top: 1rem;
    width: auto;
    z-index: 100000;
}

/* 官方核心对齐类（备用兼容） */
.alignleft {
    float: left;
    margin-right: 1.5em;
    margin-bottom: 1.5em;
}

.alignright {
    float: right;
    margin-left: 1.5em;
    margin-bottom: 1.5em;
}

.aligncenter {
    clear: both;
    display: block;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 1.5em;
}

/* 清除浮动辅助 */
.clear::before,
.clear::after {
    content: "";
    display: table;
    table-layout: fixed;
}

.clear::after {
    clear: both;
}

/* Clean, Zero-Latency Silicon Valley Native System Typography */
body, 
button, 
input, 
select, 
textarea, 
h1, h2, h3, h4, h5, h6, 
p, span, a {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =====================================================
   CodePaks Legal Document & Prose Typography Engine 
   ===================================================== */
.codepaks-legal-prose {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #475569;
}
.codepaks-legal-prose h2,
.codepaks-legal-prose h3,
.codepaks-legal-prose h4 {
    color: #0b0e1c !important;
    font-weight: 800 !important;
    letter-spacing: -0.02em !important;
}
.codepaks-legal-prose h2 {
    font-size: 1.65rem !important;
    margin-top: 2.75rem !important;
    margin-bottom: 1rem !important;
    padding-bottom: 0.5rem !important;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9) !important;
    line-height: 1.35 !important;
}
.codepaks-legal-prose h3 {
    font-size: 1.3rem !important;
    margin-top: 2rem !important;
    margin-bottom: 0.75rem !important;
    line-height: 1.4 !important;
}
.codepaks-legal-prose p {
    margin-bottom: 1.35rem !important;
    color: #475569 !important;
    line-height: 1.8 !important;
}
.codepaks-legal-prose strong,
.codepaks-legal-prose b {
    color: #0b0e1c !important;
    font-weight: 700 !important;
}
/* All content links and emails inherit default font color */
.codepaks-legal-prose a {
    color: inherit !important;
    text-decoration: underline !important;
    text-underline-offset: 3px !important;
    font-weight: 600 !important;
    transition: opacity 0.15s ease !important;
}
.codepaks-legal-prose a:hover {
    opacity: 0.75 !important;
}
.codepaks-legal-prose ul {
    list-style-type: disc !important;
    padding-left: 1.5rem !important;
    margin-bottom: 1.5rem !important;
}
.codepaks-legal-prose ol {
    list-style-type: decimal !important;
    padding-left: 1.5rem !important;
    margin-bottom: 1.5rem !important;
}
.codepaks-legal-prose li {
    margin-bottom: 0.5rem !important;
    line-height: 1.75 !important;
    color: #475569 !important;
}
.codepaks-legal-prose blockquote {
    border-left: 4px solid #2436e4 !important;
    background: #ffffff !important;
    border: 1px solid rgba(226, 232, 240, 0.8) !important;
    border-left-width: 4px !important;
    padding: 1.25rem 1.5rem !important;
    margin: 2rem 0 !important;
    border-radius: 0 1rem 1rem 0 !important;
    color: #334155 !important;
    font-style: italic !important;
}
.codepaks-legal-prose table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin: 2rem 0 !important;
    font-size: 0.925rem !important;
    background-color: #ffffff !important;
    border: 1px solid rgba(226, 232, 240, 0.9) !important;
    border-radius: 1rem !important;
    overflow: hidden !important;
}
.codepaks-legal-prose th {
    background-color: #f1f5f9 !important;
    color: #0b0e1c !important;
    font-weight: 700 !important;
    padding: 0.85rem 1.15rem !important;
    border-bottom: 2px solid #e2e8f0 !important;
    text-align: left !important;
}
.codepaks-legal-prose td {
    padding: 0.85rem 1.15rem !important;
    border-bottom: 1px solid #f1f5f9 !important;
    color: #475569 !important;
}


/* ==========================================================================
   CodePaks Live Sync Changelog & Timeline Engine (AJAX Optimized)
   ========================================================================== */
.cpk-cl-wrap {
    width: 100%;
    margin: 0;
    padding: 0;
    padding-bottom: 10px; 
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
    color: #0b0e1c;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: #F8FAFC;
}
.cpk-cl-shell {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* --- 1. Glacier Light Aurora Hero Stage --- */
.cpk-cl-hero {
    position: relative;
    overflow: hidden;
    padding: 56px 0 52px 0;
    background: #F8FAFC !important;
    color: #0b0e1c !important;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8) !important;
}
.cpk-cl-aurora {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: none !important;
    background-image: radial-gradient(circle at 15% 10%, rgba(56,189,248,0.22) 0%, transparent 45%), radial-gradient(circle at 85% 20%, rgba(91,50,232,0.15) 0%, transparent 45%) !important;
    filter: blur(35px) !important;
    opacity: 1 !important;
}
.cpk-cl-hero-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 40px;
    position: relative;
    z-index: 2;
}
.cpk-cl-eyebrow {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #2436e4;
    margin-bottom: 8px;
}
.cpk-cl-h1-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
}
.cpk-cl-h1-row h1 {
    margin: 0;
    font-size: 38px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #0b0e1c !important;
}
.cpk-cl-tag-today {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: linear-gradient(135deg, #2436e4 0%, #5b32e8 100%);
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 10px rgba(36, 54, 228, 0.4);
}
.cpk-cl-hero-desc {
    margin: 0;
    font-size: 15px;
    max-width: 580px;
    line-height: 1.5;
    color: #55607d !important;
}
.cpk-cl-livechip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 9999px;
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    background: #ffffff !important;
    border: 1px solid rgba(226, 232, 240, 0.9) !important;
    color: #334155 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important;
}
.cpk-cl-pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10B981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
    animation: cpkPulse 2s infinite;
}
@keyframes cpkPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.8; }
}

/* --- Stats Bento Bar (Light Mode) --- */
.cpk-cl-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-radius: 16px;
    padding: 20px 24px;
    margin: 0;
    position: relative;
    z-index: 2;
    background: #ffffff !important;
    border: 1px solid rgba(226, 232, 240, 0.9) !important;
    box-shadow: 0 15px 35px -10px rgba(36, 54, 228, 0.05) !important;
}
.cpk-cl-stat {
    display: flex;
    flex-direction: column;
    padding: 0 16px;
    border-right: 1px solid rgba(226, 232, 240, 0.6) !important;
}
.cpk-cl-stat:last-child {
    border-right: none !important;
}
.cpk-cl-stat dd {
    margin: 0 0 4px 0;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.02em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    color: #0b0e1c !important;
}
.cpk-cl-stat dt {
    margin: 0;
    font-size: 12.5px;
    font-weight: 600;
    text-transform: capitalize;
    color: #55607d !important;
}

/* --- 2. Filter & Navigation Controls Bar --- */
.cpk-cl-controls {
    padding: 28px 0 20px 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.cpk-cl-tabs {
    display: inline-flex;
    align-items: center;
    background: #E2E8F0;
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
    width: fit-content;
}
.cpk-cl-tab-link {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 20px;
    font-size: 13.5px;
    font-weight: 600;
    color: #475569;
    text-decoration: none;
    border-radius: 9px;
    transition: all 0.15s ease;
}
.cpk-cl-tab-link.is-active {
    background: #0b0e1c;
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
}
.cpk-cl-catbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.cpk-cl-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: #FFFFFF;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    text-decoration: none;
    transition: all 0.15s ease;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.02);
}
.cpk-cl-chip:hover {
    border-color: #2436e4;
    color: #2436e4;
    background: #F8FAFC;
}
.cpk-cl-chip.is-active {
    background: #0b0e1c;
    border-color: #0b0e1c;
    color: #FFFFFF;
}
.cpk-cl-more {
    position: relative;
    display: inline-block;
}
.cpk-cl-more summary {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.cpk-cl-more summary::-webkit-details-marker {
    display: none;
}
.cpk-cl-more summary svg {
    width: 10px !important;
    height: 10px !important;
    transition: transform 0.2s ease;
}
.cpk-cl-more[open] summary svg {
    transform: rotate(180deg);
}
.cpk-cl-more-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 320px;
    max-height: 380px;
    overflow-y: auto;
    background: #FFFFFF;
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 14px;
    padding: 8px;
    box-shadow: 0 16px 36px -6px rgba(15, 23, 42, 0.14);
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.cpk-cl-more-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    color: #334155;
    text-decoration: none;
    transition: background 0.15s ease;
}
.cpk-cl-more-item:hover {
    background: #F1F5F9;
    color: #2436e4;
}
.cpk-cl-more-count {
    font-size: 11px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    color: #94A3B8;
}

/* --- 3. Timeline Group Stream --- */
.cpk-cl-timeline {
    display: flex;
    flex-direction: column;
    gap: 36px;
    padding-bottom: 20px;
}
.cpk-cl-group {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 28px;
    align-items: flex-start;
    position: relative;
}
.cpk-cl-rail {
    position: sticky;
    top: 96px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}
.cpk-cl-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #2436e4;
    box-shadow: 0 0 0 4px rgba(36, 54, 228, 0.2);
    flex-shrink: 0;
    margin-top: 4px;
}
.cpk-cl-rail-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.cpk-cl-rail-info time {
    font-size: 18px;
    font-weight: 800;
    color: #0b0e1c;
    letter-spacing: -0.01em;
}
.cpk-cl-group-badge {
    font-size: 12px;
    font-weight: 600;
    color: #64748B;
}

/* Cards Grid (2 Columns) */
.cpk-cl-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}
.cpk-cl-card {
    background: #FFFFFF;
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 14px;
    box-shadow: 0 2px 8px -2px rgba(15, 23, 42, 0.03);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    position: relative;
    overflow: hidden;
}
.cpk-cl-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -6px rgba(15, 23, 42, 0.07);
    border-color: rgba(36, 54, 228, 0.35);
}
.cpk-cl-card-link {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    text-decoration: none;
    color: inherit;
    height: 100%;
    box-sizing: border-box;
}
.cpk-cl-thumb {
    width: 90px;
    height: 60px;
    border-radius: 10px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cpk-cl-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.cpk-cl-thumb-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F1F5F9;
    color: #64748B;
}
.cpk-cl-thumb-fallback svg {
    width: 24px !important;
    height: 24px !important;
}
.cpk-cl-body {
    flex: 1;
    min-width: 0;
}
.cpk-cl-title {
    margin: 0 0 6px 0;
    font-size: 15px;
    font-weight: 700;
    color: #0b0e1c;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cpk-cl-excerpt {
    margin: 0 0 8px 0;
    font-size: 12.5px;
    color: #64748B;
    line-height: 1.45;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}
.cpk-cl-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}
.cpk-cl-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
}
.cpk-cl-badge-ver {
    background: #F1F5F9;
    border: 1px solid #E2E8F0;
    color: #334155;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.cpk-cl-badge-gpl {
    background: rgba(36, 54, 228, 0.08);
    border: 1px solid rgba(36, 54, 228, 0.2);
    color: #2436e4;
}
.cpk-cl-badge-clean {
    background: #ECFDF5;
    border: 1px solid #A7F3D0;
    color: #059669;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.cpk-cl-badge-clean svg {
    width: 10px !important;
    height: 10px !important;
}
.cpk-cl-cat {
    font-size: 11.5px;
    color: #94A3B8;
    margin-left: 2px;
}
.cpk-cl-clock {
    font-size: 11px;
    color: #94A3B8;
    margin-left: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.cpk-cl-arrow {
    color: #94A3B8;
    font-size: 16px;
    transition: transform 0.15s ease, color 0.15s ease;
    padding-left: 4px;
    flex-shrink: 0;
}
.cpk-cl-card:hover .cpk-cl-arrow {
    transform: translateX(3px);
    color: #2436e4;
}

/* =========================================================================
   4. HIGH-TECH AJAX "LOAD MORE" BUTTON
   ========================================================================= */
.cpk-cl-loadmore-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 40px 0 70px 0;
    gap: 12px;
}
.cpk-btn-loadmore {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 48px;
    padding: 0 32px;
    background: #0b0e1c;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 9999px;
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.01em;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.05);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
    outline: none;
}
.cpk-btn-loadmore:hover:not(:disabled) {
    background: #111827;
    border-color: rgba(36, 54, 228, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(36, 54, 228, 0.3);
}
.cpk-btn-loadmore:disabled {
    background: #E2E8F0;
    border-color: #CBD5E1;
    color: #64748B;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}
.cpk-loadmore-icon {
    color: #F59E0B;
    font-size: 15px;
}
.cpk-loadmore-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: #FFFFFF;
    border-radius: 50%;
    animation: cpkSpin 0.75s linear infinite;
}
@keyframes cpkSpin {
    to { transform: rotate(360deg); }
}
.cpk-btn-loadmore.is-loading .cpk-loadmore-spinner {
    display: inline-block;
}
.cpk-btn-loadmore.is-loading .cpk-loadmore-icon {
    display: none;
}

/* Responsive */
@media (max-width: 900px) {
    .cpk-cl-group {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .cpk-cl-rail {
        position: relative;
        top: 0;
    }
    .cpk-cl-cards {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 640px) {
    .cpk-cl-hero-row {
        flex-direction: column;
        gap: 16px;
    }
    .cpk-cl-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
    .cpk-cl-stat {
        border-right: none !important;
        padding: 0;
    }
    .cpk-btn-loadmore {
        width: 100%;
    }
}