/*
 * 壁纸档案样式：与 src/style.scss 同一套 token，但独立成文件——
 * 首页的 index.css 由 MiniCssExtract 从 JS 依赖图里抽出来，档案页不引 main.js，
 * 所以这里手写一份等价的静态表，改设计语言时两边都要动。
 */

@font-face {
    font-family: idea;
    src: url(https://resources.jetbrains.com/storage/jetbrains-sans/JetBrainsSans.woff2);
}

:root {
    --gap: 14px;
    --r-lg: 20px;
    --r-md: 14px;
    --r-pill: 999px;
    --page-bg: linear-gradient(to bottom right, #06283f 0%, #10151b 55%, #241f1f 100%);
    --ease: cubic-bezier(.22, .68, .32, 1);
}

html[data-theme="dark"] {
    color-scheme: dark;
    --glass: rgba(255, 255, 255, .10);
    --glass-strong: rgba(255, 255, 255, .17);
    --stroke: rgba(255, 255, 255, .21);
    --txt: #fff;
    --txt-dim: rgba(255, 255, 255, .62);
    --txt-faint: rgba(255, 255, 255, .38);
    --shadow: 0 18px 40px -18px rgba(0, 0, 0, .75);
    --accent: #ff8686;
    --btn-solid-bg: #fff;
    --btn-solid-fg: #10151b;
}

html[data-theme="light"] {
    color-scheme: light;
    --page-bg: linear-gradient(to bottom right, #d9e6f2 0%, #f3f5f8 55%, #ece5df 100%);
    --glass: rgba(255, 255, 255, .58);
    --glass-strong: rgba(255, 255, 255, .74);
    --stroke: rgba(255, 255, 255, .8);
    --txt: #14171c;
    --txt-dim: rgba(20, 23, 28, .66);
    --txt-faint: rgba(20, 23, 28, .4);
    --shadow: 0 18px 40px -22px rgba(0, 0, 0, .45);
    --accent: #d2452a;
    --btn-solid-bg: #14171c;
    --btn-solid-fg: #fff;
}

@supports not (backdrop-filter: blur(1px)) {
    html[data-theme="dark"] {
        --glass: rgba(24, 28, 35, .78);
        --glass-strong: rgba(28, 33, 41, .88);
    }

    html[data-theme="light"] {
        --glass: rgba(255, 255, 255, .86);
        --glass-strong: rgba(255, 255, 255, .94);
    }
}

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

html {
    background: var(--page-bg);
    background-attachment: fixed;
}

body {
    margin: 0;
    color: var(--txt);
    font: 13px/1.65 idea, "Inter", system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* width/height 属性的表现性提示会压住 aspect-ratio 把图拉形，必须显式放开高度 */
img {
    height: auto;
    max-width: 100%;
}

a {
    color: inherit;
}

main {
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px 22px 64px;
}

.wp-top {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 22px;
    background: var(--glass);
    border-bottom: 1px solid var(--stroke);
    backdrop-filter: blur(16px) saturate(150%);
}

.wp-brand {
    font-weight: 700;
    letter-spacing: .04em;
    text-decoration: none;
}

.wp-top nav {
    display: flex;
    gap: 7px;
    align-items: center;
    font-size: 12px;
    color: var(--txt-dim);
}

.wp-top nav a {
    text-decoration: none;
}

.wp-top nav a:hover {
    color: var(--accent);
}

.wp-sp {
    flex: 1;
}

.wp-alt {
    padding: 5px 12px;
    border: 1px solid var(--stroke);
    border-radius: var(--r-pill);
    font-size: 12px;
    text-decoration: none;
    background: var(--glass-strong);
}

h1 {
    margin: 4px 0 6px;
    font-size: 26px;
    letter-spacing: -.01em;
}

h2 {
    margin: 30px 0 8px;
    font-size: 15px;
}

.wp-lead {
    margin: 0 0 20px;
    color: var(--txt-dim);
    max-width: 68ch;
}

.wp-kicker {
    color: var(--txt-faint);
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.wp-frame {
    display: block;
    margin: 0 0 18px;
    border: 1px solid var(--stroke);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.wp-frame img {
    display: block;
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.wp-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--gap);
}

.wp-tile {
    display: block;
    border: 1px solid var(--stroke);
    border-radius: var(--r-md);
    overflow: hidden;
    background: var(--glass);
    text-decoration: none;
    transition: transform .2s var(--ease), border-color .2s;
}

.wp-tile:hover {
    transform: translateY(-3px);
    border-color: var(--accent);
}

.wp-tile img {
    display: block;
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
}

.wp-cap {
    display: block;
    padding: 9px 11px 11px;
}

.wp-t {
    display: block;
    font-size: 12.5px;
    line-height: 1.4;
}

.wp-d {
    display: block;
    margin-top: 3px;
    color: var(--txt-faint);
    font-size: 11px;
}

.wp-body {
    display: block;
}

.wp-panel {
    margin: 0 0 18px;
    padding: 16px;
    border: 1px solid var(--stroke);
    border-radius: var(--r-lg);
    background: var(--glass);
    backdrop-filter: blur(14px) saturate(150%);
}

.wp-panel dl {
    margin: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 5px 12px;
    font-size: 12px;
}

.wp-panel dt {
    color: var(--txt-faint);
}

.wp-panel dd {
    margin: 0;
    color: var(--txt-dim);
    word-break: break-word;
}

.wp-dl {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: 14px;
}

.wp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 16px;
    border: 1px solid var(--stroke);
    border-radius: var(--r-pill);
    background: var(--glass-strong);
    color: var(--txt);
    font-size: 12.5px;
    text-decoration: none;
    transition: transform .2s var(--ease);
}

.wp-btn:hover {
    transform: translateY(-1px);
}

.wp-btn.solid {
    border-color: transparent;
    background: var(--btn-solid-bg);
    color: var(--btn-solid-fg);
    font-weight: 600;
}

.wp-neigh {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 6px 0 4px;
}

.wp-neigh a {
    text-decoration: none;
    font-size: 12px;
    color: var(--txt-faint);
}

.wp-neigh a span {
    display: block;
}

.wp-neigh b {
    display: block;
    margin-top: 2px;
    font-size: 13px;
    font-weight: 600;
    color: var(--txt);
}

.wp-right {
    text-align: right;
}

.wp-pager {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 20px;
}

.wp-pager a,
.wp-cur {
    padding: 6px 12px;
    border: 1px solid var(--stroke);
    border-radius: var(--r-pill);
    font-size: 12px;
    text-decoration: none;
    color: var(--txt-dim);
}

.wp-cur {
    border-color: transparent;
    background: var(--btn-solid-bg);
    color: var(--btn-solid-fg);
}

.wp-prose {
    margin-top: 30px;
    max-width: 68ch;
    color: var(--txt-dim);
}

.wp-prose p {
    margin: 0 0 10px;
}

.wp-prose strong {
    color: var(--txt);
}

.wp-prose code {
    padding: 1px 5px;
    border-radius: 5px;
    background: var(--glass-strong);
    font-size: 12px;
}

.wp-foot {
    max-width: 1180px;
    margin: 34px auto 0;
    padding: 18px 22px 40px;
    border-top: 1px solid var(--stroke);
    color: var(--txt-faint);
    font-size: 11.5px;
}

.wp-foot p {
    margin: 0 0 6px;
}

.wp-cta {
    color: var(--txt-dim);
}

@media (min-width: 860px) {
    /* 详情页宽屏：图占主栏，署名与下载侧栏顶到标题线以下，相邻日期仍在主栏 */
    .wp-day .wp-body {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 300px;
        grid-template-areas:
            "frame panel"
            "neigh panel";
        gap: 0 22px;
        align-items: start;
    }

    .wp-day .wp-frame {
        grid-area: frame;
    }

    .wp-day .wp-neigh {
        grid-area: neigh;
    }

    .wp-day .wp-panel {
        grid-area: panel;
        margin-top: 34px;
    }
}

@media (max-width: 900px) {
    .wp-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

    main {
        padding: 20px 16px 48px;
    }

    h1 {
        font-size: 22px;
    }
}
