:root {
    color-scheme: light;
    --page-bg: #f5f6f8;
    --surface: #ffffff;
    --text: #17191c;
    --muted: #626972;
    --line: #e4e7eb;
    --accent: #246bfe;
}

* { box-sizing: border-box; }
html {
    margin: 0;
    background: var(--page-bg);
    scroll-behavior: smooth;
}
body.content-page {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    color: var(--text);
    background: var(--page-bg);
    font-family: "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, sans-serif;
    line-height: 1.75;
}

/* The page class is in the original HTML, so this final layout is applied before first paint. */
body.content-page > h1 {
    max-width: 980px;
    margin: 40px auto 30px !important;
    padding: 0 16px;
    font-size: clamp(2.2rem, 6vw, 5rem) !important;
    line-height: 1.12;
    letter-spacing: -0.04em;
    text-align: center;
    text-wrap: balance;
}
body.content-page > p,
body.content-page > section,
body.content-page > form,
body.content-page > div:not(.video-grid):not(.bilibili-section) {
    max-width: 900px;
    margin-right: auto;
    margin-left: auto;
}

/* Photo pages use source images directly: no card, crop, border radius, shadow, or inter-image gap. */
body.content-page > img,
.media-gallery img,
.content-cover {
    display: block;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    object-fit: initial !important;
}
body.content-page > img + img,
.media-gallery img + img { margin-top: 0 !important; }
.media-gallery {
    display: flex;
    width: 100%;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 0;
}

/* BGM remains native autoplay + loop. There is deliberately no custom control or progress bar. */
body.content-page > audio { display: none !important; }

body.content-page section[id="introduction"] {
    margin-top: 22px;
    margin-bottom: 22px;
    padding: 20px 24px;
    border: 1px solid var(--line);
    color: var(--muted);
    background: var(--surface);
    overflow-wrap: anywhere;
}
body.content-page section[id="introduction"] p { margin: 0; }

body.content-page form {
    margin-top: 24px;
    margin-bottom: 24px;
    padding: 24px;
    border: 1px solid var(--line);
    background: var(--surface);
}
body.content-page input,
body.content-page select,
body.content-page button {
    max-width: 100%;
    margin: 6px 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 11px 13px;
    font: inherit;
}
body.content-page input[type="button"],
body.content-page button { color: #fff; background: var(--accent); cursor: pointer; }

.video-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin: 18px auto 32px;
}
.video-grid video {
    display: block;
    width: 100% !important;
    height: auto !important;
    max-height: 78vh;
    object-fit: contain !important;
}

.bilibili-section {
    max-width: 1000px;
    margin: 34px auto;
    padding: 24px;
    border: 1px solid var(--line);
    background: var(--surface);
}
.bilibili-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}
.bilibili-heading h2 { margin: 0; font-size: 1.65rem; }
.bilibili-kicker { margin: 0 0 3px; color: #fb7299; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.16em; }
.bilibili-heading a {
    flex: 0 0 auto;
    padding: 9px 15px;
    color: #fff;
    background: #fb7299;
    font-size: 0.9rem;
    text-decoration: none;
}
.bilibili-title { margin: 0 0 18px; font-size: 1.08rem; line-height: 1.6; }
.bilibili-player-list { display: grid; gap: 20px; }
.bilibili-player-item > h3 { margin: 0 0 8px; color: var(--muted); font-size: 0.92rem; }
.bilibili-player-frame {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #000;
    aspect-ratio: 16 / 9;
}
.bilibili-player-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; }
.bilibili-description { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 16px; }
.bilibili-description summary { color: var(--muted); font-weight: 700; cursor: pointer; }
.bilibili-description p { margin: 12px 0 0; color: var(--muted); line-height: 1.85; white-space: normal; overflow-wrap: anywhere; }

@media (max-width: 720px) {
    body.content-page > h1 { margin-top: 28px !important; margin-bottom: 24px !important; }
    .video-grid { grid-template-columns: 1fr; gap: 11px; }
    .bilibili-section { padding: 18px 14px; }
    .bilibili-heading { align-items: flex-start; }
    .bilibili-heading h2 { font-size: 1.35rem; }
}
