/* ==========================================================================
   std::cpp — article archive
   ========================================================================== */

.page-list {
    background:
        radial-gradient(ellipse 60% 40% at 72% 0%, rgba(6, 182, 212, 0.08), transparent 70%),
        radial-gradient(ellipse 46% 36% at 12% 6%, rgba(37, 99, 235, 0.09), transparent 72%);
}

/* ------------------------------------------------------------------ hero */

.archive-hero {
    position: relative;
    padding: 42px 0 30px;
    overflow: hidden;
}

.archive-hero::after {
    content: "";
    position: absolute;
    left: -10%;
    right: -10%;
    bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.18), transparent);
}

.archive-watermark {
    position: absolute;
    top: 12px;
    right: -30px;
    color: rgba(37, 99, 235, 0.045);
    font-family: var(--mono);
    font-size: clamp(70px, 10vw, 130px);
    font-weight: 700;
    letter-spacing: -0.07em;
    line-height: 1;
    white-space: nowrap;
    pointer-events: none;
    -webkit-user-select: none;
    user-select: none;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 34px;
    color: var(--muted-2);
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.03em;
}

.breadcrumb a {
    color: var(--muted);
}

.breadcrumb a:hover {
    color: var(--blue);
}

.breadcrumb .sep {
    color: rgba(37, 99, 235, 0.3);
}

.breadcrumb .current {
    color: var(--blue);
}

.archive-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 40px;
}

.archive-row h1 {
    margin: 14px 0 12px;
    color: var(--ink);
    font-family: var(--mono);
    font-size: clamp(38px, 5.4vw, 62px);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.055em;
}

.archive-row h1 .prefix {
    color: rgba(37, 99, 235, 0.32);
    font-weight: 500;
}

.archive-row h1 .cursor {
    display: inline-block;
    width: 0.42em;
    height: 0.82em;
    margin-left: 0.08em;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--blue), var(--cyan));
    animation: caret-blink 1.1s steps(1) infinite;
    vertical-align: -0.04em;
}

.archive-row p {
    max-width: 560px;
    margin: 0;
    color: var(--muted);
    font-size: 14.5px;
    line-height: 1.8;
}

.archive-count {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 148px;
    padding: 22px 16px 18px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: var(--shadow-sm);
    flex: none;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.archive-count strong {
    position: relative;
    color: var(--ink);
    font-family: var(--mono);
    font-size: 38px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.06em;
}

.archive-count strong::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -8px;
    width: 26px;
    height: 2px;
    border-radius: 2px;
    background: var(--grad);
    transform: translateX(-50%);
}

.archive-count span {
    margin-top: 13px;
    color: var(--muted-2);
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.archive-count .pulse-dot {
    position: absolute;
    top: 13px;
    right: 13px;
}

/* --------------------------------------------------------------- controls */

.archive-controls {
    position: relative;
    margin-top: 34px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 22px 50px -30px rgba(37, 99, 235, 0.35), inset 0 0 0 1px rgba(37, 99, 235, 0.05);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}

.search-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-field {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    min-width: 0;
}

.search-field svg {
    position: absolute;
    left: 16px;
    width: 17px;
    height: 17px;
    color: var(--muted-2);
    pointer-events: none;
    transition: color 0.2s ease;
}

.search-field input {
    width: 100%;
    height: 48px;
    padding: 0 124px 0 45px;
    border: 1px solid var(--line);
    border-radius: 11px;
    outline: none;
    color: var(--ink-2);
    background: rgba(248, 250, 255, 0.9);
    font-size: 13.5px;
    transition: border-color 0.2s ease, box-shadow 0.25s ease, background 0.2s ease;
}

.search-field input::placeholder {
    color: var(--muted-2);
}

.search-field input:focus {
    border-color: rgba(37, 99, 235, 0.45);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

.search-field:focus-within svg {
    color: var(--blue);
}

.search-shortcut {
    position: absolute;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--muted-2);
    font-family: var(--mono);
    font-size: 9.5px;
    pointer-events: none;
}

.search-shortcut kbd {
    min-width: 19px;
    padding: 2px 5px;
    border: 1px solid var(--line);
    border-bottom-width: 2px;
    border-radius: 5px;
    background: #fff;
    font-family: var(--mono);
    font-size: 9px;
    text-align: center;
}

.search-form .btn {
    flex: none;
    min-height: 48px;
    padding-inline: 26px;
}

.filter-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed rgba(37, 99, 235, 0.12);
}

.filter-label {
    margin-right: 4px;
    color: var(--muted-2);
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.08em;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--muted);
    background: rgba(37, 99, 235, 0.045);
    font-family: var(--mono);
    font-size: 10.5px;
    transition: all 0.2s ease;
}

.filter-chip:hover {
    color: var(--blue);
    border-color: rgba(37, 99, 235, 0.22);
    background: rgba(37, 99, 235, 0.08);
}

.filter-chip.is-active {
    color: #fff;
    background: var(--grad);
    box-shadow: 0 6px 16px -8px rgba(37, 99, 235, 0.7);
}

.filter-empty {
    color: var(--muted-2);
    font-family: var(--mono);
    font-size: 10px;
}

/* ------------------------------------------------------------------ body */

.archive-body {
    padding: 48px 0 20px;
}

.archive-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 286px;
    gap: 38px;
    align-items: start;
}

.result-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
    padding: 0 4px;
    color: var(--muted-2);
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.03em;
}

.result-bar .query {
    color: var(--blue);
}

.result-bar .result-page {
    flex: none;
}

.post-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.post-card {
    position: relative;
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 18px;
    padding: 24px 26px 22px 0;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: rgba(255, 255, 255, 0.74);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
    transition: transform 0.32s var(--ease), box-shadow 0.32s ease, border-color 0.32s ease, background 0.32s ease;
}

.post-card::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0;
    background: radial-gradient(520px circle at 12% 0%, rgba(37, 99, 235, 0.08), transparent 60%);
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.post-card::after {
    content: "";
    position: absolute;
    top: 20px;
    bottom: 20px;
    left: 0;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--grad);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.35s var(--ease);
}

.post-card:hover {
    background: #fff;
    border-color: rgba(37, 99, 235, 0.2);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.post-card:hover::before {
    opacity: 1;
}

.post-card:hover::after {
    transform: scaleY(1);
}

.post-number {
    position: relative;
    display: flex;
    justify-content: flex-end;
    padding-top: 2px;
    color: rgba(37, 99, 235, 0.28);
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.post-number::after {
    content: "";
    position: absolute;
    top: 9px;
    right: -10px;
    bottom: 2px;
    width: 1px;
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.18), transparent);
}

.post-main {
    position: relative;
    z-index: 1;
    min-width: 0;
}

.post-topline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 8px;
    color: var(--muted-2);
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.03em;
}

.post-category {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--blue);
    background: rgba(37, 99, 235, 0.07);
    font-size: 9.5px;
}

.post-category::before {
    content: "#";
    opacity: 0.5;
}

.post-topline .dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--muted-2);
    opacity: 0.6;
}

.post-card h2 {
    margin: 0 0 9px;
    font-size: 19px;
    font-weight: 650;
    line-height: 1.45;
    letter-spacing: -0.02em;
}

.post-card h2 a {
    color: var(--ink-2);
}

.post-card h2 a:hover {
    color: var(--blue);
}

.post-summary {
    margin: 0 0 17px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.8;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-top: 14px;
    border-top: 1px dashed rgba(37, 99, 235, 0.1);
}

.post-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    color: var(--muted-2);
    font-family: var(--mono);
    font-size: 10px;
}

.post-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.post-meta svg {
    width: 12px;
    height: 12px;
    opacity: 0.7;
}

.post-read {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: none;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 10.5px;
    transition: color 0.2s ease;
}

.post-read svg {
    width: 13px;
    height: 13px;
    transition: transform 0.25s var(--ease);
}

.post-card:hover .post-read {
    color: var(--blue);
}

.post-card:hover .post-read svg {
    transform: translateX(4px);
}

/* --------------------------------------------------------------- sidebar */

.archive-aside {
    position: sticky;
    top: calc(var(--nav-h) + 22px);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tags-index .tag-cloud {
    gap: 7px;
}

.tips-card {
    padding: 20px 20px 18px;
    border: 1px solid rgba(37, 99, 235, 0.16);
    border-radius: 16px;
    background: linear-gradient(150deg, rgba(37, 99, 235, 0.07), rgba(6, 182, 212, 0.05) 60%, rgba(124, 58, 237, 0.06));
}

.tips-card h3 {
    margin: 0 0 8px;
    color: var(--ink-2);
    font-size: 14px;
    font-weight: 650;
}

.tips-card p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.8;
}

.tips-code {
    margin-top: 13px;
    padding: 11px 12px;
    border-radius: 9px;
    color: #8aa0bd;
    background: #0c1830;
    font-family: var(--mono);
    font-size: 9.5px;
    line-height: 1.9;
    overflow-x: auto;
    white-space: nowrap;
}

.tips-code .kw { color: #c084fc; }
.tips-code .str { color: #fcd34d; }
.tips-code .dim { color: #526580; }

.publish-card {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.8);
}

.publish-card h3 {
    margin: 0 0 6px;
    color: var(--ink-2);
    font-size: 14px;
    font-weight: 650;
}

.publish-card p {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.75;
}

.publish-card .btn {
    width: 100%;
}

/* ------------------------------------------------------------- pagination */

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 34px;
    padding-top: 24px;
    border-top: 1px dashed rgba(37, 99, 235, 0.12);
}

.page-btn {
    display: grid;
    place-items: center;
    min-width: 38px;
    height: 38px;
    padding: 0 11px;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.78);
    font-family: var(--mono);
    font-size: 11px;
    transition: all 0.2s ease;
}

.page-btn:hover {
    color: var(--blue);
    border-color: rgba(37, 99, 235, 0.3);
    transform: translateY(-1px);
}

.page-btn.is-active {
    color: #fff;
    background: var(--grad);
    border-color: transparent;
    box-shadow: 0 8px 18px -8px rgba(37, 99, 235, 0.7);
}

.page-btn.is-disabled {
    opacity: 0.4;
    pointer-events: none;
}

.page-gap {
    padding: 0 3px;
    color: var(--muted-2);
    font-family: var(--mono);
    font-size: 10px;
}

.page-info {
    margin-left: 8px;
    color: var(--muted-2);
    font-family: var(--mono);
    font-size: 10px;
}

/* ------------------------------------------------------------- empty state */

.empty-state {
    position: relative;
    padding: 66px 30px;
    border: 1px dashed rgba(37, 99, 235, 0.24);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.55);
    text-align: center;
    overflow: hidden;
}

.empty-state::before {
    content: "";
    position: absolute;
    top: -80px;
    left: 50%;
    width: 300px;
    height: 300px;
    margin-left: -150px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.1), transparent 66%);
    pointer-events: none;
}

.empty-state .empty-code {
    position: relative;
    display: inline-block;
    padding: 5px 12px;
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--blue);
    background: rgba(255, 255, 255, 0.9);
    font-family: var(--mono);
    font-size: 11px;
}

.empty-state h2 {
    position: relative;
    margin: 18px 0 8px;
    color: var(--ink-2);
    font-size: 19px;
    font-weight: 650;
    letter-spacing: -0.02em;
}

.empty-state p {
    position: relative;
    margin: 0 0 22px;
    color: var(--muted);
    font-size: 13px;
}

/* --------------------------------------------------------------- responsive */

@media (max-width: 1000px) {
    .archive-grid {
        grid-template-columns: minmax(0, 1fr) 250px;
        gap: 24px;
    }

    .post-card {
        padding-right: 20px;
    }
}

@media (max-width: 860px) {
    .archive-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .archive-aside {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .archive-aside .tags-index {
        grid-column: 1 / -1;
    }

    .archive-count {
        width: 126px;
    }

    .archive-count strong {
        font-size: 32px;
    }
}

@media (max-width: 640px) {
    .archive-hero {
        padding-top: 26px;
    }

    .breadcrumb {
        margin-bottom: 24px;
    }

    .archive-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 22px;
    }

    .archive-count {
        flex-direction: row;
        align-items: baseline;
        gap: 10px;
        width: auto;
        padding: 12px 16px;
    }

    .archive-count strong {
        font-size: 24px;
    }

    .archive-count strong::after {
        display: none;
    }

    .archive-count span {
        margin: 0;
    }

    .archive-count .pulse-dot {
        position: static;
    }

    .archive-controls {
        padding: 14px;
    }

    .search-form {
        flex-direction: column;
        align-items: stretch;
    }

    .search-field input {
        padding-right: 16px;
    }

    .search-shortcut {
        display: none;
    }

    .search-form .btn {
        width: 100%;
    }

    .result-bar {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .post-card {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
        padding: 20px 20px 18px;
    }

    .post-number {
        justify-content: flex-start;
        margin-bottom: 10px;
        padding: 0;
        font-size: 11px;
    }

    .post-number::after {
        display: none;
    }

    .post-card h2 {
        font-size: 17px;
    }

    .post-footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .archive-aside {
        grid-template-columns: minmax(0, 1fr);
    }

    .archive-aside .tags-index {
        grid-column: auto;
    }

    .pagination {
        justify-content: flex-start;
    }

    .page-info {
        width: 100%;
        margin: 6px 0 0;
    }
}
