/* Final WP archive rules. This is loaded after theme-specific styles so the
   archive keeps one surface hierarchy in every supported colour theme. */
body[data-theme-area="frontend"].route-writeups-index .writeup-filter-form .span-keyword {
    grid-column: auto !important;
}

body[data-theme-area="frontend"].route-writeups-index .writeup-filter-form .query-control {
    display: block !important;
    background: transparent !important;
    box-shadow: none !important;
}

body[data-theme-area="frontend"].route-writeups-index .writeup-side-stack {
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 12px;
    height: min(calc(100dvh - 112px), 760px) !important;
    max-height: min(calc(100dvh - 112px), 760px) !important;
    overflow: hidden !important;
}

body[data-theme-area="frontend"].route-writeups-index .writeup-index-panel {
    min-height: 0;
    max-height: none !important;
    overflow: hidden !important;
}

body[data-theme-area="frontend"].route-writeups-index .writeup-index-list {
    min-height: 0;
    overflow: auto !important;
}

body[data-theme-area="frontend"].route-writeups-index .writeup-submit-panel {
    min-width: 0;
    margin: 0 !important;
    box-shadow: none !important;
}

body[data-theme-area="frontend"].route-writeups-index .writeup-submit-panel h2 {
    margin: 0;
    font-size: 1rem;
}

body[data-theme-area="frontend"].route-writeups-index .writeup-submit-panel p {
    margin: 7px 0 0;
    color: var(--ink-muted, #64748b);
    font-size: .84rem;
    line-height: 1.6;
}

body[data-theme-area="frontend"].route-writeups-index .writeup-list-surface {
    padding: 0 !important;
}

body[data-theme-area="frontend"].route-writeups-index :is(
    .writeup-filter-surface,
    .writeup-list-surface,
    .writeup-index-panel,
    .writeup-submit-panel
) {
    box-shadow: none !important;
}

body.theme-dark[data-theme-area="frontend"].route-writeups-index :is(
    .writeup-filter-surface,
    .writeup-list-surface,
    .writeup-index-panel,
    .writeup-submit-panel
) {
    box-shadow: none !important;
}

body.theme-dark-new.theme-dark[data-theme-area="frontend"].route-writeups-index .writeup-filter-surface,
body.theme-dark-new.theme-dark[data-theme-area="frontend"].route-writeups-index .writeup-list-surface,
body.theme-dark-new.theme-dark[data-theme-area="frontend"].route-writeups-index .writeup-index-panel,
body.theme-dark-new.theme-dark[data-theme-area="frontend"].route-writeups-index .writeup-submit-panel {
    box-shadow: none !important;
}

@media (max-width: 1024px) {
    body[data-theme-area="frontend"].route-writeups-index .writeup-side-stack {
        display: contents !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    body[data-theme-area="frontend"].route-writeups-index .writeup-submit-panel {
        order: -1;
    }

    body[data-theme-area="frontend"].route-writeups-index .writeup-index-panel,
    body[data-theme-area="frontend"].route-writeups-index .writeup-index-list {
        overflow: visible !important;
    }
}

/* 未登录登录墙：前 1/4 正文 + Medium 风格登录/注册提示（与 wiki 登录墙同源样式） */
.writeup-login-wall-teaser { position: relative; }

.writeup-login-wall-fade {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 150px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0), var(--surface, #fff) 92%);
    pointer-events: none;
}

.writeup-login-wall {
    margin: 4px 0 28px;
    padding: 34px 28px;
    text-align: center;
    background: color-mix(in srgb, var(--surface, #fff) 92%, var(--accent, #2563eb) 8%);
    border: 1px solid var(--border, #e4e4e7);
    border-radius: 14px;
}

.writeup-login-wall-inner { max-width: 540px; margin: 0 auto; }

.writeup-login-wall-title {
    margin: 0 0 10px;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--ink, #172033);
}

.writeup-login-wall-sub {
    margin: 0 auto 22px;
    font-size: 15px;
    line-height: 1.65;
    color: color-mix(in srgb, var(--ink, #172033) 72%, transparent);
}

.writeup-login-wall-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.writeup-login-wall-btn {
    min-width: 140px;
    padding: 11px 22px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 10px;
}

.writeup-login-wall-note {
    margin: 18px 0 0;
    font-size: 12.5px;
    color: color-mix(in srgb, var(--ink, #172033) 55%, transparent);
}

.writeup-prose-loading {
    display: flex;
    align-items: center;
    min-height: 240px;
}

.writeup-loading-copy,
.writeup-outline-loading {
    color: var(--muted, #64748b);
    font-size: 13px;
    line-height: 1.55;
}
