@font-face {
    font-family: 'Bole';
    src: url('../fonts/bole-subset.woff2') format('woff2');
    font-display: swap;
}

:root {
    --accent: #a3545f;
    --paper: #fbf6ec;
    --ink: #38322e;
    --ink-soft: #6f655d;
    --line: rgba(56, 50, 46, .16);
    --hand: 'Bole', 'Kaiti SC', 'STKaiti', 'KaiTi', serif;
    --body: -apple-system, 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
    --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body, h1, h2, p, ul, figure, blockquote { margin: 0; padding: 0; }
ul { list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

html { background: #2b2a33; }
body {
    min-height: 100dvh;
    color: var(--ink);
    font: 15px/1.75 var(--body);
    -webkit-font-smoothing: antialiased;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }

/* 壁纸：清晰的一层放主体，模糊的一层垫底，手帐压在两者交界处 */
.wall { position: fixed; inset: 0; overflow: hidden; }
.layer { position: absolute; inset: 0; opacity: 0; transition: opacity .9s ease; }
.layer.in { opacity: 1; }
.layer b, .layer u { position: absolute; display: block; background-image: var(--img); background-size: cover; }
.layer b { inset: -60px; background-position: center; filter: blur(36px) brightness(.72) saturate(1.1); }
.layer u {
    inset: 0 26% 0 0;
    background-position: var(--pos);
    -webkit-mask-image: linear-gradient(90deg, #000 72%, transparent);
    mask-image: linear-gradient(90deg, #000 72%, transparent);
}
.wall::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(20, 18, 24, .72), rgba(20, 18, 24, 0) 34%);
}

.page {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(440px, 38vw, 540px);
    gap: 48px;
    align-items: end;
    min-height: 100dvh;
    padding: 32px clamp(32px, 6vw, 96px) 32px 48px;
}

/* 手帐 */
.book {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    position: relative;
    animation: rise .7s var(--ease) both;
}
.paper {
    position: relative;
    height: min(580px, calc(100dvh - 112px));
    padding: 32px 40px 28px;
    overflow: auto;
    background-color: var(--paper);
    background-image: radial-gradient(rgba(56, 50, 46, .13) 1px, transparent 1.2px);
    background-size: 20px 20px;
    border-radius: 3px 10px 10px 10px;
    box-shadow: 0 30px 60px -20px rgba(16, 12, 24, .55), 0 2px 0 rgba(255, 255, 255, .5) inset;
}
.book::before {
    content: '';
    position: absolute;
    inset: 54px -7px -7px 7px;
    background: #efe7d7;
    border-radius: 3px 10px 10px 10px;
    transform: rotate(1.1deg);
    box-shadow: 0 16px 30px -14px rgba(16, 12, 24, .5);
}

.tabs { position: relative; display: flex; gap: 4px; padding-left: 16px; }
.tab {
    height: 44px;
    padding: 2px 22px 0;
    font: 21px/1 var(--hand);
    color: #fff;
    background: rgba(40, 36, 44, .55);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    border-radius: 10px 10px 0 0;
    transform: translateY(6px);
    transition: transform .25s var(--ease), background-color .25s;
}
.tab:hover { transform: translateY(2px); }
.tab:active { transform: translateY(5px); }
.tab[aria-selected="true"] { color: var(--accent); background: var(--paper); transform: none; }

.panel { display: none; }
.panel.active { display: block; animation: fade .35s ease both; }
html:not(.js) .panel { display: block; margin-bottom: 40px; }

/* 简介 */
.id { display: flex; align-items: center; gap: 24px; }
.photo {
    position: relative;
    flex: none;
    width: 104px;
    padding: 6px;
    background: #fff;
    box-shadow: 0 8px 16px -8px rgba(40, 30, 30, .45);
    transform: rotate(-3.5deg);
}
.photo::before, .receipt::before {
    content: '';
    position: absolute;
    top: -11px;
    left: 50%;
    width: 64px;
    height: 20px;
    margin-left: -32px;
    background: color-mix(in srgb, var(--accent) 55%, transparent);
    transform: rotate(2.5deg);
}
h1 {
    font: 52px/1.1 var(--hand);
    color: var(--accent);
    letter-spacing: .01em;
}
.sub { margin-top: 6px; color: var(--ink-soft); text-wrap: pretty; }

.likes { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 26px; }
.likes li { font: 21px/1.5 var(--hand); }
.likes li:not(:last-child)::after { content: '/'; margin-left: 14px; color: var(--accent); opacity: .6; }
del { text-decoration-color: var(--accent); text-decoration-thickness: 2px; color: var(--ink-soft); }

.motto {
    margin-top: 26px;
    padding-left: 18px;
    border-left: 3px solid var(--accent);
}
.motto p { font: 34px/1.35 var(--hand); }

.note { margin-top: 18px; color: var(--ink-soft); }

.uptime {
    margin-top: 22px;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
    font-size: 13px;
    color: var(--ink-soft);
    font-variant-numeric: tabular-nums;
}

/* 链接：目录页 */
h2 { font: 26px/1.3 var(--hand); color: var(--accent); }
.toc + h2 { margin-top: 24px; }
.toc { margin-top: 6px; }
.toc a {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-height: 44px;
    padding-top: 7px;
    transition: color .2s, transform .25s var(--ease);
}
.toc span { font: 23px/1.3 var(--hand); }
.toc i { flex: 1; border-bottom: 2px dotted var(--line); transform: translateY(-3px); }
.toc small { font-size: 13px; color: var(--ink-soft); }
.toc a:hover { color: var(--accent); transform: translateX(4px); }
.toc a:active { transform: translateX(2px); }

/* 求助 */
h2.big { font-size: 36px; margin-bottom: 12px; }
.receipt {
    position: relative;
    width: 216px;
    margin: 24px auto 0;
    padding: 10px 10px 6px;
    background: #fff;
    box-shadow: 0 10px 18px -10px rgba(40, 30, 30, .45);
    transform: rotate(1.6deg);
}
.receipt figcaption { margin-top: 4px; font: 18px/1.5 var(--hand); text-align: center; }
.qq {
    display: table;
    margin: 20px auto 0;
    color: var(--accent);
    border-bottom: 1px solid currentColor;
    transition: opacity .2s;
}
.qq:hover { opacity: .7; }

/* 壁纸上的一句话 */
.caption {
    grid-column: 1;
    grid-row: 1;
    max-width: 560px;
    color: #fff;
    animation: fade .8s .3s ease both;
}
.caption p { font-size: 22px; line-height: 1.5; font-weight: 500; text-wrap: pretty; text-shadow: 0 1px 12px rgba(0, 0, 0, .5); }
.caption cite { display: block; min-height: 22px; margin-top: 4px; font-size: 13px; font-style: normal; opacity: .75; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: 16px; font-size: 13px; }
.row nav { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.row a { opacity: .78; transition: opacity .2s; }
.row a:hover { opacity: 1; }
.caption :focus-visible { outline-color: #fff; }
.swap {
    padding: 5px 14px;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .5);
    border-radius: 6px;
    transition: background-color .2s, transform .15s;
}
.swap:hover { background: rgba(255, 255, 255, .18); }
.swap:active { transform: translateY(1px); }
.swap[disabled] { opacity: .5; cursor: progress; }

@keyframes rise { from { opacity: 0; transform: translateY(24px); } }
@keyframes fade { from { opacity: 0; } }

/* 窄屏：壁纸在上，手帐作为一张纸从下方盖上来 */
@media (max-width: 900px) {
    .layer u {
        inset: 0 0 auto;
        height: 62dvh;
        -webkit-mask-image: linear-gradient(0deg, transparent, #000 30%);
        mask-image: linear-gradient(0deg, transparent, #000 30%);
    }
    .wall::after { display: none; }
    .page { display: block; padding: 40dvh 16px 24px; }
    .book { max-width: 560px; margin: 0 auto; }
    .paper { height: auto; min-height: 480px; padding: 26px 22px; overflow: visible; }
    .caption { max-width: 560px; margin: 28px auto 0; }
    .caption p { font-size: 18px; }
    h1 { font-size: 44px; }
    .motto p { font-size: 29px; }
    .id { gap: 18px; }
    .photo { width: 88px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
