@font-face {
    font-family: 'liuhuan';
    src: url(./刘欢卡通手书1.07.ttf);
}

@font-face {
    font-family: 'pinru';
    src: url('../images/品如手写体.ttf');
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'liuhuan', sans-serif;
}



:root {
    --bg-color: #070b2b;
    --text-dark: #e8ecff;
    --overlay-radial: rgba(255, 255, 255, 0.08);
    --overlay-bottom: rgba(4, 10, 40, 0.68);
    --overlay-top: rgba(4, 10, 40, 0.32);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Serif SC', serif;
    background-color: var(--bg-color);
    background-image: radial-gradient(circle at 20% 18%, rgba(86, 104, 214, 0.2) 0%, rgba(7, 11, 43, 0) 45%),
        radial-gradient(circle at 82% 80%, rgba(129, 152, 255, 0.16) 0%, rgba(7, 11, 43, 0) 48%);
    overflow-x: hidden;
    color: var(--text-dark);
}

.frame-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    background: url(../images/b.png) center center / cover no-repeat;
}

/* bling bling 闪光粒子 */
.sparkle-container {
    position: fixed;
    inset: 0;
    z-index: 10000;
    pointer-events: none;
    overflow: hidden;
}

.sparkle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, #fff 0%, rgba(220, 235, 255, 0.9) 25%, rgba(180, 210, 255, 0.5) 50%, transparent 100%);
    box-shadow: 0 0 6px 2px rgba(255, 255, 255, 0.4);
    animation: sparkle-blink var(--dur) var(--delay) infinite;
}

.sparkle::before,
.sparkle::after {
    content: '';
    position: absolute;
    background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.95), transparent);
    top: 50%;
    left: 50%;
}

.sparkle::before {
    width: 2px;
    height: 220%;
    transform: translate(-50%, -50%);
}

.sparkle::after {
    width: 220%;
    height: 2px;
    transform: translate(-50%, -50%);
}

@keyframes sparkle-blink {
    0%, 100% {
        opacity: 0;
        transform: scale(0.3) rotate(0deg);
    }
    15% {
        opacity: 1;
        transform: scale(1) rotate(20deg);
    }
    30% {
        opacity: 0.6;
        transform: scale(0.8) rotate(40deg);
    }
    45% {
        opacity: 1;
        transform: scale(1.1) rotate(60deg);
    }
    60% {
        opacity: 0.3;
        transform: scale(0.6) rotate(80deg);
    }
    80% {
        opacity: 0;
        transform: scale(0.2) rotate(100deg);
    }
}

/* 导航装饰 */

.nav-decor {
    position: fixed;
    top: 28px;
    right: 26px;
    z-index: 100;
    writing-mode: vertical-rl;
    letter-spacing: 0.35em;
    font-weight: 700;
    font-size: 0.82rem;
    border-right: 1px solid rgba(216, 226, 255, 0.55);
    padding: 10px 8px 10px 0;
    color: #eaf0ff;
    background: rgba(16, 26, 92, 0.45);
    backdrop-filter: blur(3px);
}

/* 版块通用样式 */

section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;

}

section::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 70% 36%, var(--overlay-radial), rgba(255, 255, 255, 0) 40%),
        linear-gradient(0deg, var(--overlay-bottom), var(--overlay-top));
    pointer-events: none;
    z-index: 1;
}

/* 首页特有样式 */

#home {
    background: url(../images/bg1.png);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 70px 5vw 60px;
    --overlay-bottom: rgba(4, 10, 40, 0.58);
    --overlay-top: rgba(4, 10, 40, 0.22);
}

/* #home::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 70% 36%, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0) 40%),
        linear-gradient(0deg, rgba(4, 10, 40, 0.85), rgba(4, 10, 40, 0.3));
    pointer-events: none;
    z-index: 1;
} */

.home-shell {
    width: min(900px, 92vw);
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1.05fr 1.35fr;
    align-items: end;
    gap: 42px;
}

.home-heading {
    padding-bottom: 16px;
}

.main-title {
    font-size: clamp(3rem, 6vw, 2.4rem);
    letter-spacing: 0.18em;
    line-height: 1.1;
    margin-bottom: 18px;
    color: #f6f8ff;
    text-shadow: 0 3px 14px rgba(102, 121, 255, 0.35);
}

.home-subtitle {
    letter-spacing: 0.32em;
    font-size: 0.95rem;
    color: #ccd8ff;
    margin-bottom: 26px;
}

.home-intro {
    max-width: 34ch;
    line-height: 1.9;
    color: #d3dbff;
    font-size: 0.98rem;
}

.home-gallery {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: 110px;
    gap: 14px;
}

.home-card {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(198, 209, 255, 0.3);
    box-shadow: 0 16px 36px rgba(3, 6, 28, 0.45);
}

.home-card:nth-child(1) {
    grid-column: 1 / span 6;
    grid-row: 1 / span 3;
}

.home-card:nth-child(2) {
    grid-column: 7 / span 3;
    grid-row: 1 / span 2;
}

.home-card:nth-child(3) {
    grid-column: 10 / span 3;
    grid-row: 1 / span 4;
}

.home-card:nth-child(4) {
    grid-column: 1 / span 9;
    grid-row: 4 / span 2;
}

.home-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.9s ease;
}

.home-card:hover img {
    transform: scale(1.04);
}

.home-card span {
    position: absolute;
    left: 14px;
    bottom: 14px;
    padding: 5px 12px;
    font-size: 0.82rem;
    background: rgba(13, 28, 102, 0.58);
    color: #eef3ff;
    border-radius: 999px;
    letter-spacing: 0.12em;
    backdrop-filter: blur(3px);
}

/* 角色版块样式 */

.char-section {
    background-color: #090f3a;
    padding: 60px 0;
}

.content-box {
    position: relative;
    z-index: 2;
    width: min(1180px, 88vw);
    min-height: 74vh;
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    align-items: center;
    gap: clamp(28px, 4vw, 68px);
}

/* 图片容器 - 异形裁剪 */

.img-wrap {
    position: relative;
    width: 100%;
    height: clamp(440px, 68vh, 700px);
    clip-path: polygon(10% 0, 100% 0, 90% 100%, 0 100%);
    overflow: hidden;
    background: #0f174f;
    border-radius: 16px;
    border: 1px solid rgba(201, 211, 255, 0.2);
}

.img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: contrast(1.08) saturate(0.85) brightness(0.9);
    transition: transform 1s ease;
}

/* 文字介绍 */

.info-wrap {
    padding: 24px 10px 24px 0;
    position: relative;
    z-index: 2;
    max-width: 54ch;
    background: rgba(20, 34, 108, 0.5);
    border: 1px solid rgba(205, 215, 255, 0.2);
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(3, 7, 30, 0.36);
    padding-left: 26px;
    padding-right: 26px;
}

.mbti-tag {
    font-size: 1rem;
    color: #bdc9ff;
    margin-bottom: 14px;
    display: block;
    letter-spacing: 0.12em;
}

.char-name {
    font-size: clamp(2.4rem, 4.8vw, 4.4rem);
    margin-bottom: 24px;
    border-bottom: 2px solid var(--text-dark);
    display: inline-block;
    padding-bottom: 8px;
    letter-spacing: 0.04em;
}

.char-desc {
    font-size: 1.02rem;
    line-height: 1.95;
    text-align: justify;
    color: #dbe2ff;
}

.char-desc p {
    font-family: 'pinru', 'Noto Serif SC', serif;
}

.char-actions {
    margin-top: 22px;
}

.detail-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
    padding: 10px 20px;
    border-radius: 999px;
    text-decoration: none;
    color: #eef3ff;
    letter-spacing: 0.14em;
    font-size: 0.82rem;
    font-weight: 700;
    border: 1px solid rgba(210, 219, 255, 0.45);
    background: linear-gradient(135deg, rgba(31, 58, 157, 0.76), rgba(15, 26, 88, 0.76));
    box-shadow: 0 8px 18px rgba(2, 6, 28, 0.3);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.detail-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(2, 6, 28, 0.4);
    border-color: rgba(233, 239, 255, 0.8);
}

/* 背景大字装饰 */

.bg-text {
    position: absolute;
    font-size: 20vw;
    color: rgba(210, 220, 255, 0.07);
    z-index: -1;
    white-space: nowrap;
    font-weight: 900;
    pointer-events: none;
    user-select: none;
}

/* 不同章节配色 */

.section-1 {
    background: url(../images/bg.png);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    --overlay-bottom: rgba(4, 10, 40, 0.68);
    --overlay-top: rgba(4, 10, 40, 0.32);
}

/* 顾时夜 - 沉稳 */
.section-1 .content-box {
    grid-template-columns: 1.2fr 1fr;
}

.section-1 .img-wrap {
    clip-path: polygon(8% 0, 100% 0, 92% 100%, 0 100%);
}

.section-1 .char-name {
    color: #f0f4ff;
}

.section-1 .info-wrap {
    background: rgba(23, 38, 120, 0.45);
}

.section-2 {
    background: url(../images/bg1.png);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    --overlay-bottom: rgba(4, 10, 40, 0.68);
    --overlay-top: rgba(4, 10, 40, 0.32);
}

/* 易遇 - 清冷 */
.section-2 .content-box {
    grid-template-columns: 1fr 1fr;
}

.section-2 .img-wrap {
    clip-path: polygon(0 0, 100% 6%, 90% 100%, 0 94%);
    border-radius: 0 40px 0 40px;
}

.section-2 .char-name {
    color: #ecf3ff;
}

.section-2 .char-desc {
    max-width: 44ch;
}

.section-2 .info-wrap {
    background: rgba(22, 46, 125, 0.42);
}

.section-3 {
    background: url(../images/bg.png);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    --overlay-bottom: rgba(4, 10, 40, 0.68);
    --overlay-top: rgba(4, 10, 40, 0.32);
}

/* 柏源 - 热烈 */
.section-3 .content-box {
    grid-template-columns: 1fr 1.2fr;
}

.section-3 .img-wrap {
    clip-path: polygon(0 0, 84% 0, 100% 100%, 15% 100%);
    border: 3px solid rgba(202, 88, 56, 0.25);
}

.section-3 .char-name {
    color: #f4f6ff;
}

.section-3 .mbti-tag {
    color: #b8c7ff;
}

.section-3 .info-wrap {
    background: rgba(28, 42, 118, 0.45);
}

.section-4 {
    background: url(../images/bg1.png);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    --overlay-bottom: rgba(4, 10, 40, 0.68);
    --overlay-top: rgba(4, 10, 40, 0.32);
}

/* 夏萧因 - 疏离 */
.section-4 .content-box {
    grid-template-columns: 1.25fr 1fr;
    gap: 70px;
}

.section-4 .img-wrap {
    clip-path: ellipse(70% 60% at 50% 50%);
}

.section-4 .char-name {
    color: #edf0ff;
}

.section-4 .char-desc {
    font-style: italic;
}

.section-4 .info-wrap {
    background: rgba(23, 40, 116, 0.44);
}

.section-2 .content-box,
.section-4 .content-box {
    direction: rtl;
}

.section-2 .info-wrap,
.section-2 .img-wrap,
.section-4 .info-wrap,
.section-4 .img-wrap {
    direction: ltr;
}

/* ==========================================
   iPad 横屏 / 小桌面 (<=1100px)
   ========================================== */
@media (max-width: 1100px) {
    body {
        font-size: 15px;
    }

    #home {
        padding: 54px 4vw 44px;
    }

    .home-shell {
        grid-template-columns: 1fr;
        gap: 26px;
        width: 94vw;
    }

    .home-heading {
        text-align: center;
    }

    .home-intro {
        max-width: none;
        margin: 0 auto;
    }

    .home-gallery {
        grid-template-columns: 1fr 1fr;
        grid-auto-rows: auto;
        gap: 12px;
    }

    .home-card:nth-child(1) {
        grid-column: 1 / -1;
        grid-row: auto;
        height: 36vw;
    }

    .home-card:nth-child(2) {
        grid-column: auto;
        grid-row: auto;
        height: 42vw;
        border-radius: 14px 6px 14px 6px;
    }

    .home-card:nth-child(3) {
        grid-column: auto;
        grid-row: auto;
        height: 32vw;
        margin-top: 10vw;
        border-radius: 6px 14px 6px 14px;
    }

    .home-card:nth-child(4) {
        grid-column: 1 / -1;
        grid-row: auto;
        height: 26vw;
        border-radius: 6px 6px 14px 14px;
    }

    .home-card img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .content-box {
        width: 92vw;
        gap: clamp(18px, 3vw, 36px);
    }

    .section-4 .content-box {
        gap: 28px;
    }

    .img-wrap {
        height: auto;
        min-height: 0;
    }

    .img-wrap img {
        width: 100%;
        height: auto;
        max-height: 54vh;
        object-fit: contain;
        filter: none;
    }
}

/* ==========================================
   iPad 竖屏 / 大手机横屏 (<=768px)
   ========================================== */
@media (max-width: 768px) {
    body {
        font-size: 14px;
    }

    .sparkle {
        box-shadow: 0 0 3px 1px rgba(255, 255, 255, 0.25);
    }

    .sparkle::before {
        width: 1px;
        height: 180%;
    }

    .sparkle::after {
        width: 180%;
        height: 1px;
    }

    .nav-decor {
        top: 12px;
        right: 10px;
        font-size: 0.62rem;
        letter-spacing: 0.16em;
        padding: 6px 5px 6px 0;
    }

    .frame-overlay {
        display: none;
    }

    section {
        min-height: auto;
        padding: 36px 0;
    }

    #home {
        padding: 44px 4vw 34px;
    }

    .main-title {
        font-size: clamp(1.5rem, 6vw, 2.2rem);
        letter-spacing: 0.12em;
        margin-bottom: 10px;
    }

    .home-subtitle {
        font-size: 0.75rem;
        letter-spacing: 0.16em;
        margin-bottom: 12px;
    }

    .home-intro {
        font-size: 0.82rem;
        line-height: 1.7;
    }

    .home-gallery {
        grid-template-columns: 1fr 1fr;
        grid-auto-rows: auto;
        gap: 10px;
    }

    .home-card {
        border-radius: 12px;
    }

    .home-card:nth-child(1) {
        grid-column: 1 / -1;
        height: 52vw;
    }

    .home-card:nth-child(1) img {
        object-position: center 30%;
    }

    .home-card:nth-child(2) {
        height: 62vw;
        border-radius: 12px 4px 12px 4px;
    }

    .home-card:nth-child(3) {
        height: 48vw;
        margin-top: 14vw;
        border-radius: 4px 12px 4px 12px;
    }

    .home-card:nth-child(4) {
        grid-column: 1 / -1;
        height: 38vw;
        border-radius: 4px 4px 12px 12px;
    }

    .home-card img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: top center;
        max-height: none;
    }

    .home-card span {
        font-size: 0.68rem;
        left: 8px;
        bottom: 8px;
        padding: 3px 8px;
    }

    .content-box,
    .section-1 .content-box,
    .section-2 .content-box,
    .section-3 .content-box,
    .section-4 .content-box {
        width: 92vw;
        grid-template-columns: 1fr;
        gap: 16px;
        direction: ltr;
        min-height: auto;
    }

    .img-wrap {
        height: auto;
        min-height: 0;
        clip-path: none;
        border-radius: 10px;
    }

    .img-wrap img {
        max-height: 46vh;
    }

    .section-1 .img-wrap,
    .section-2 .img-wrap,
    .section-3 .img-wrap,
    .section-4 .img-wrap {
        clip-path: none;
        border-radius: 10px;
    }

    .info-wrap {
        max-width: none;
        padding: 16px;
    }

    .char-name {
        font-size: clamp(1.4rem, 5vw, 2rem);
        margin-bottom: 10px;
        padding-bottom: 6px;
    }

    .mbti-tag {
        font-size: 0.76rem;
        margin-bottom: 8px;
    }

    .char-desc {
        font-size: 0.82rem;
        line-height: 1.7;
    }

    .char-desc p {
        font-size: 0.82rem;
    }

    .detail-btn {
        min-width: 100px;
        padding: 7px 14px;
        font-size: 0.72rem;
    }

    .bg-text {
        font-size: 24vw;
    }

    .char-section {
        padding: 30px 0;
    }

    .char-actions {
        margin-top: 12px;
    }
}

/* ==========================================
   手机横屏 / 小平板 (<=640px)
   ========================================== */
@media (max-width: 640px) {
    body {
        font-size: 13px;
    }

    section {
        padding: 32px 0;
    }

    #home {
        padding: 36px 4vw 30px;
    }

    .char-section {
        padding: 26px 0;
    }

    .home-shell {
        width: 96vw;
        gap: 16px;
    }

    .main-title {
        font-size: clamp(1.3rem, 7vw, 1.8rem);
        letter-spacing: 0.08em;
        margin-bottom: 8px;
    }

    .home-subtitle {
        letter-spacing: 0.1em;
        font-size: 0.68rem;
        margin-bottom: 8px;
    }

    .home-intro {
        font-size: 0.76rem;
        line-height: 1.65;
    }

    .home-gallery {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .home-card:nth-child(1) {
        height: 50vw;
    }

    .home-card:nth-child(2) {
        height: 58vw;
    }

    .home-card:nth-child(3) {
        height: 44vw;
        margin-top: 14vw;
    }

    .home-card:nth-child(4) {
        height: 36vw;
    }

    .home-card img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: top center;
        max-height: none;
    }

    .img-wrap img {
        max-height: 42vh;
    }

    .home-card span {
        font-size: 0.64rem;
        left: 6px;
        bottom: 6px;
        padding: 2px 6px;
    }

    .img-wrap {
        height: auto;
    }

    .content-box {
        width: 94vw;
    }

    .info-wrap {
        padding: 14px 12px;
        border-radius: 8px;
    }

    .char-name {
        font-size: 1.2rem;
        padding-bottom: 4px;
        margin-bottom: 8px;
        border-bottom-width: 1px;
    }

    .mbti-tag {
        font-size: 0.68rem;
        margin-bottom: 6px;
    }

    .char-desc {
        font-size: 0.76rem;
        line-height: 1.62;
    }

    .char-desc p {
        font-size: 0.76rem;
    }

    .detail-btn {
        min-width: 86px;
        padding: 6px 12px;
        font-size: 0.66rem;
    }

    .char-actions {
        margin-top: 10px;
    }
}

/* ==========================================
   手机竖屏极窄 (<=480px)
   ========================================== */
@media (max-width: 480px) {
    body {
        font-size: 12px;
    }

    .nav-decor {
        top: 8px;
        right: 6px;
        font-size: 0.52rem;
        letter-spacing: 0.1em;
        padding: 4px 4px 4px 0;
    }

    #home {
        padding: 32px 3vw 24px;
    }

    .main-title {
        font-size: 1.2rem;
        letter-spacing: 0.06em;
    }

    .home-subtitle {
        font-size: 0.6rem;
    }

    .home-intro {
        font-size: 0.7rem;
        line-height: 1.6;
    }

    .home-gallery {
        gap: 6px;
    }

    .home-card:nth-child(1) {
        height: 48vw;
    }

    .home-card:nth-child(2) {
        height: 56vw;
    }

    .home-card:nth-child(3) {
        height: 42vw;
        margin-top: 14vw;
    }

    .home-card:nth-child(4) {
        height: 34vw;
    }

    .home-card img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: top center;
        max-height: none;
    }

    .img-wrap img {
        max-height: 38vh;
    }

    .home-card span {
        font-size: 0.58rem;
        left: 6px;
        bottom: 6px;
        padding: 2px 6px;
    }

    section {
        padding: 24px 0;
    }

    .char-section {
        padding: 20px 0;
    }

    .img-wrap {
        height: auto;
    }

    .char-name {
        font-size: 1.1rem;
    }

    .char-desc {
        font-size: 0.7rem;
        line-height: 1.58;
    }

    .char-desc p {
        font-size: 0.7rem;
    }

    .mbti-tag {
        font-size: 0.62rem;
        margin-bottom: 6px;
    }

    .detail-btn {
        min-width: 76px;
        padding: 5px 10px;
        font-size: 0.6rem;
    }

    .bg-text {
        font-size: 30vw;
    }

    .info-wrap {
        padding: 12px 10px;
        box-shadow: 0 6px 14px rgba(3, 7, 30, 0.2);
        border-radius: 6px;
    }
}

/* ==========================================
   超小屏 (<=375px)
   ========================================== */
@media (max-width: 375px) {
    .main-title {
        font-size: 1rem;
    }

    .home-card:nth-child(1) { height: 46vw; }
    .home-card:nth-child(2) { height: 54vw; }
    .home-card:nth-child(3) { height: 40vw; margin-top: 14vw; }
    .home-card:nth-child(4) { height: 32vw; }

    .char-name {
        font-size: 1rem;
    }

    .char-desc,
    .char-desc p {
        font-size: 0.65rem;
    }
}