*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ========== 加载界面 ========== */
#loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #0c0c14;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    transition: opacity 0.6s ease;
}

#loader.loader-hide {
    opacity: 0;
    pointer-events: none;
}

.loader-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.1em;
}

.loader-bar {
    width: 240px;
    height: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
    overflow: hidden;
}

.loader-fill {
    height: 100%;
    width: 0;
    background: #EE1166;
    border-radius: 2px;
    transition: width 0.3s ease;
}

:root {
    --vbs: #EE1166;
    --bg: #0c0c14;
    --text: #f0e8ec;
    --text-dim: rgba(240,232,236,0.45);
}

html, body {
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
}

/* ========== 顶部条 ========== */
.top-strip {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 48px;
    display: flex;
    z-index: 100;
    background: #1a1a24;
}

/* 左侧梯形 40% */
.strip-trap {
    width: fit-content;
    height: 100%;
    background: var(--vbs);
    display: flex;
    align-items: center;
    padding: 0 4rem 0 1.8rem;
    clip-path: polygon(0 0, 100% 0, calc(100% - 36px) 100%, 0 100%);
}

.strip-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.12em;
    white-space: nowrap;
    text-decoration: none;
}

/* 右侧区域 */
.strip-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
}

.strip-vbs {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: transparent;
    -webkit-text-stroke: 1.5px rgba(238,17,102,0.7);
}

/* 移动端菜单按钮 (默认隐藏) */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 102;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: #fff;
    margin: 5px 0;
    transition: 0.3s;
}

.strip-nav {
    display: flex;
    align-items: center;
    gap: 1.8rem;
}

.nav-link {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    transition: color 0.2s;
}

.nav-link:hover, .nav-link.active {
    color: var(--vbs);
}

/* ========== 首屏 KV ========== */
.kv {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    padding-top: 48px;
    padding-bottom: 42px;
    overflow: hidden;
}

/* 滚动文字条 */
.kv-marquee {
    background: var(--vbs);
    overflow: hidden;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.marquee-track {
    display: flex;
    white-space: nowrap;
    animation: scroll 18s linear infinite;
}

.marquee-track span {
    font-size: 0.68rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.12em;
}

@keyframes scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* 标题区 —— 在角色上方居中 */
.kv-title {
    text-align: center;
    padding: 0.8rem 0 0.3rem;
    z-index: 10;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
}

.kv-title h1 {
    font-family: 'Noto Sans SC', sans-serif;
    font-size: clamp(2.6rem, 5.5vw, 4rem);
    font-weight: 900;
    letter-spacing: 0.12em;
    font-style: italic;
    letter-spacing: 0.15em;
}

.kv-only {
    display: none;
}

.kv-sub {
    font-size: 0.72rem;
    color: var(--text-dim);
    letter-spacing: 0.2em;
    margin-top: 0.2rem;
}

/* 角色立绘 */
.kv-chars {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    overflow: hidden;
    position: relative;
    padding-top: 5rem;
}

/* ========== 背景装饰 ========== */

/* 倾斜方框 1 */
.kv-chars::before {
    content: '';
    position: absolute;
    inset: 3% 8%;
    border: 2px solid rgba(238,17,102,0.35);
    transform: rotate(-1.5deg);
    pointer-events: none;
}

/* 倾斜方框 2 */
.kv-chars::after {
    content: '';
    position: absolute;
    inset: 7% 12%;
    border: 2px solid rgba(255,255,255,0.12);
    transform: rotate(2deg);
    pointer-events: none;
}

/* 全屏斜线 + 竖排文字 */
.kv-bg-deco {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    background:
        repeating-linear-gradient(
            -45deg,
            transparent,
            transparent 24px,
            rgba(238,17,102,0.07) 24px,
            rgba(238,17,102,0.07) 25px
        ),
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 40px,
            rgba(255,255,255,0.03) 40px,
            rgba(255,255,255,0.03) 41px
        );
}

/* 左侧竖排文字 */
.kv-bg-deco::before {
    content: 'VIVID BAD SQUAD VIVID BAD SQUAD VIVID BAD SQUAD VIVID BAD SQUAD VIVID BAD SQUAD';
    position: absolute;
    top: 0; left: 2%;
    width: 20px; height: 100%;
    writing-mode: vertical-rl;
    font-size: 0.65rem; font-weight: 800;
    letter-spacing: 0.3em;
    color: rgba(238,17,102,0.2);
    white-space: nowrap; overflow: hidden;
}

/* 右侧竖排文字 */
.kv-bg-deco::after {
    content: 'VIVID BAD SQUAD VIVID BAD SQUAD VIVID BAD SQUAD VIVID BAD SQUAD VIVID BAD SQUAD';
    position: absolute;
    top: 0; right: 2%;
    width: 20px; height: 100%;
    writing-mode: vertical-rl;
    font-size: 0.65rem; font-weight: 800;
    letter-spacing: 0.3em;
    color: rgba(238,17,102,0.2);
    white-space: nowrap; overflow: hidden;
    transform: rotate(180deg);
}

/* 角落 L 形线 */
.corner-deco {
    position: absolute;
    pointer-events: none;
    z-index: 1;
}
.corner-deco.tl {
    top: 4%; left: 2.5%;
    width: 90px; height: 90px;
    border-top: 3px solid rgba(255,255,255,0.25);
    border-left: 3px solid rgba(255,255,255,0.25);
}
.corner-deco.tr {
    top: 4%; right: 2.5%;
    width: 90px; height: 90px;
    border-top: 3px solid rgba(238,17,102,0.45);
    border-right: 3px solid rgba(238,17,102,0.45);
}
.corner-deco.bl {
    bottom: 6%; left: 2.5%;
    width: 90px; height: 90px;
    border-bottom: 3px solid rgba(238,17,102,0.45);
    border-left: 3px solid rgba(238,17,102,0.45);
}
.corner-deco.br {
    bottom: 6%; right: 2.5%;
    width: 90px; height: 90px;
    border-bottom: 3px solid rgba(255,255,255,0.25);
    border-right: 3px solid rgba(255,255,255,0.25);
}

/* 十字线 */
.cross-deco {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}
.cross-deco::before {
    content: '';
    position: absolute;
    top: 50%; left: 3%; right: 3%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1) 20%, rgba(238,17,102,0.15) 50%, rgba(255,255,255,0.1) 80%, transparent);
}
.cross-deco::after {
    content: '';
    position: absolute;
    left: 50%; top: 3%; bottom: 3%;
    width: 1px;
    background: linear-gradient(180deg, transparent, rgba(238,17,102,0.12) 20%, rgba(255,255,255,0.1) 50%, rgba(238,17,102,0.12) 80%, transparent);
}

/* 额外斜线装饰 */
.slash-deco {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

/* 左上大斜线 */
.slash-deco::before {
    content: '';
    position: absolute;
    top: -10%; left: 6%;
    width: 3px; height: 50%;
    background: linear-gradient(180deg, rgba(238,17,102,0.4), transparent);
    transform: rotate(25deg);
    transform-origin: top left;
}

/* 右上大斜线 */
.slash-deco::after {
    content: '';
    position: absolute;
    top: -10%; right: 6%;
    width: 3px; height: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.2), transparent);
    transform: rotate(-25deg);
    transform-origin: top right;
}

/* 散落小线段 */
.line-bits {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.line-bit {
    position: absolute;
    background: rgba(238,17,102,0.3);
}

.line-bit:nth-child(1) { width: 40px; height: 2px; top: 15%; left: 8%; transform: rotate(-30deg); }
.line-bit:nth-child(2) { width: 55px; height: 2px; top: 25%; right: 10%; transform: rotate(20deg); background: rgba(255,255,255,0.15); }
.line-bit:nth-child(3) { width: 30px; height: 2px; top: 70%; left: 5%; transform: rotate(45deg); }
.line-bit:nth-child(4) { width: 45px; height: 2px; top: 60%; right: 7%; transform: rotate(-15deg); background: rgba(255,255,255,0.15); }
.line-bit:nth-child(5) { width: 35px; height: 2px; top: 40%; left: 12%; transform: rotate(10deg); background: rgba(255,255,255,0.12); }
.line-bit:nth-child(6) { width: 50px; height: 2px; top: 80%; right: 12%; transform: rotate(-40deg); }
.line-bit:nth-child(7) { width: 25px; height: 2px; top: 50%; left: 6%; transform: rotate(-60deg); background: rgba(255,255,255,0.1); }
.line-bit:nth-child(8) { width: 60px; height: 2px; top: 35%; right: 4%; transform: rotate(35deg); }

/* 移动端滑动指示器 (默认隐藏) */
.slider-dots {
    display: none;
    position: absolute;
    bottom: 15%;
    left: 50%;
    transform: translateX(-50%);
    gap: 8px;
    z-index: 60;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.slider-dots.show {
    opacity: 1;
}

.slider-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transition: all 0.3s ease;
}

.slider-dots .dot.active {
    background: var(--vbs);
    transform: scale(1.3);
}

/* ========== 角色容器 + 剪影交互 ========== */
.char-wrap {
    position: relative;
    height: 90%;
    margin: 0 -3.5% 2rem;
    flex-shrink: 0;
    display: flex;
    align-items: flex-end;
}

.char-wrap img {
    height: 100%;
    width: auto;
    object-fit: contain;
    object-position: bottom;
    filter: drop-shadow(0 2px 12px rgba(0,0,0,0.5));
    transition: filter 0.4s ease;
}

/* 悬停/点击时 —— 角色本身不变 */

/* 剪影 canvas（默认隐藏，和 img 完全重合） */
.char-shadow {
    position: absolute;
    bottom: 0;
    height: 100%;
    width: auto;
    object-fit: contain;
    pointer-events: none;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* 剪影继承角色 img 的 transform */
.char-wrap:has(.char-an) .char-shadow { transform: translateY(-3%) translateX(20%); }
.char-wrap:has(.char-khn) .char-shadow { transform: translateY(8%); }
.char-wrap:has(.char-center) .char-shadow { transform: translateY(-5%); }
.char-wrap:has(.char-akt) .char-shadow { transform: translateY(8%) translateX(3%); }
.char-wrap:has(.char-toya) .char-shadow { transform: translateY(2%) translateX(-17%); }

.char-wrap.active .char-shadow {
    opacity: 0.75;
}

/* 激活时：在基础定位上叠加外散 */
.char-wrap[data-side="left"].active:has(.char-an) .char-shadow {
    transform: translateY(-3%) translateX(20%) translate(-25px, -18px);
}
.char-wrap[data-side="left"].active:has(.char-khn) .char-shadow {
    transform: translateY(8%) translate(-25px, -18px);
}
.char-wrap[data-side="center"].active:has(.char-center) .char-shadow {
    transform: translateY(-5%) translate(0, -25px);
}
.char-wrap[data-side="right"].active:has(.char-akt) .char-shadow {
    transform: translateY(8%) translateX(3%) translate(25px, -18px);
}
.char-wrap[data-side="right"].active:has(.char-toya) .char-shadow {
    transform: translateY(2%) translateX(-17%) translate(25px, -18px);
}

/* 对话气泡 */
.char-quote {
    position: absolute;
    top: 25%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: rgba(10, 10, 18, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    border: 1.5px solid var(--char-color, rgba(255,255,255,0.2));
    box-shadow: 0 0 12px var(--char-color, transparent), 0 4px 16px rgba(0,0,0,0.4);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s ease, transform 0.35s ease;
    z-index: 20;
}

/* 小三角 */
.char-quote::after {
    content: '';
    position: absolute;
    bottom: -7px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 7px solid var(--char-color, rgba(255,255,255,0.2));
}

.char-wrap.active .char-quote {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* 每个角色的应援色变量 */
.char-wrap:has(.char-an) { --char-color: #00BBDD; }
.char-wrap:has(.char-khn) { --char-color: #FF6699; }
.char-wrap:has(.char-center) { --char-color: #33CCBB; }
.char-wrap:has(.char-akt) { --char-color: #FF7722; }
.char-wrap:has(.char-toya) { --char-color: #0077DD; }

/* khn 和 akt 对话框下移 */
.char-wrap:has(.char-khn) .char-quote,
.char-wrap:has(.char-akt) .char-quote {
    top: 40%;
}

/* miku 对话框微调 */
.char-wrap:has(.char-center) .char-quote {
    top: 28%;
}

/* 保持原有定位 */
.char-wrap:has(.char-back) { z-index: 1; }
.char-wrap:has(.char-front) { z-index: 3; }
.char-wrap:has(.char-center) { z-index: 2; }
.char-wrap:has(.char-an) img { transform: translateY(-3%) translateX(20%); }
.char-wrap:has(.char-khn) img { transform: translateY(8%); }
.char-wrap:has(.char-toya) img { transform: translateY(2%) translateX(-17%); }
.char-wrap:has(.char-akt) img { transform: translateY(8%) translateX(3%); }
.char-wrap:has(.char-center) img { transform: translateY(-5%); }

/* 单独位移已移至 .char-wrap:has() */

/* 右侧信息 */
.kv-info {
    position: fixed;
    right: 4rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
    z-index: 50;
}

.kv-info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.kv-info-item.show {
    opacity: 1;
    transform: translateX(0);
}

.kv-info-item .label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    background: var(--vbs);
    padding: 0.2rem 0.5rem;
    letter-spacing: 0.06em;
}

.kv-info-item .value {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

/* ========== 页脚 ========== */
.kv-bottom-line {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 42px;
    background: var(--vbs);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-text {
    color: #fff;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.1em;
}

/* ========== 左侧信息板块 ========== */
.side-info {
    position: fixed;
    left: 4rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    background: rgba(238, 17, 102, 0.5);
    padding: 0.8rem 1rem;
    border-radius: 8px;
}

.side-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: rgba(255,255,255,0.85);
    letter-spacing: 0.1em;
}

.side-link {
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.05em;
    transition: opacity 0.2s;
}

.side-link:hover {
    opacity: 0.8;
}

.qr-placeholder {
    width: 130px;
    height: 130px;
    margin-top: 0.5rem;
    border-radius: 6px;
    overflow: hidden;
}

.qr-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

/* ========== 底部描边标题 ========== */
.bg-title {
    position: absolute;
    bottom: 8%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 0;
    font-size: clamp(3rem, 6vw, 5.5rem);
    font-weight: 900;
    font-style: italic;
    letter-spacing: 0.1em;
    white-space: nowrap;
    color: transparent;
    -webkit-text-stroke: 1.5px rgba(255,255,255,0.35);
    pointer-events: none;
}

/* ========== 聚光灯 ========== */
.spotlight {
    position: absolute;
    width: 25%;
    height: 45%;
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.spotlight-top {
    top: 0;
}

.spotlight-bottom {
    bottom: 0;
}

.spotlight-l { left: 10%; }
.spotlight-c { left: 50%; transform: translateX(-50%); }
.spotlight-r { right: 10%; }

.spotlight-top.spotlight-l {
    background: radial-gradient(ellipse at 50% 0%, rgba(238,17,102,0.22) 0%, transparent 70%);
}
.spotlight-top.spotlight-c {
    background: radial-gradient(ellipse at 50% 0%, rgba(255,255,255,0.15) 0%, transparent 70%);
}
.spotlight-top.spotlight-r {
    background: radial-gradient(ellipse at 50% 0%, rgba(238,17,102,0.22) 0%, transparent 70%);
}
.spotlight-bottom.spotlight-l {
    background: radial-gradient(ellipse at 50% 100%, rgba(238,17,102,0.18) 0%, transparent 70%);
}
.spotlight-bottom.spotlight-c {
    background: radial-gradient(ellipse at 50% 100%, rgba(255,255,255,0.12) 0%, transparent 70%);
}
.spotlight-bottom.spotlight-r {
    background: radial-gradient(ellipse at 50% 100%, rgba(238,17,102,0.18) 0%, transparent 70%);
}

.spotlight.on {
    opacity: 1;
}

.spotlight.off {
    opacity: 0;
}

/* ========== 入场动画 ========== */
.kv-title {
    opacity: 0;
    transition: opacity 0.8s ease;
}
.side-info {
    opacity: 0;
    transform: translateY(-50%) translateX(-120%);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.kv-chars .char-wrap {
    opacity: 0;
    transition: opacity 1.2s ease;
}

.kv-title.show {
    opacity: 1;
}
.side-info.show {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}
.kv-chars .char-wrap.show {
    opacity: 1;
}

/* 跳过入场动画（非首次访问） */
.no-intro .kv-title,
.no-intro .bg-deco-layer .spotlight {
    opacity: 1 !important;
    transition: none !important;
}
/* 桌面端非首次访问时显示所有角色 */
@media (min-width: 769px) {
    .no-intro .kv-chars .char-wrap {
        opacity: 1 !important;
        transition: none !important;
    }
}
.no-intro .side-info {
    opacity: 1 !important;
    /* 移除这里的 !important transform，让媒体查询能够覆盖 */
    transition: none !important;
}
.no-intro .kv-info-item {
    opacity: 1 !important;
    transform: translateX(0) !important;
    transition: none !important;
}
.no-intro .lines-float-entry.show {
    opacity: 1;
}
/* ========== 页面切换过渡 ========== */
.page-content {
    animation: pageIn 0.4s ease;
}

body.page-leaving .page-content,
body.page-leaving .kv {
    animation: pageOut 0.3s ease forwards;
}
body.page-leaving .side-info,
body.page-leaving .kv-info {
    animation: pageOut 0.3s ease forwards;
}
body.page-leaving .lines-float-entry {
    animation: pageOut 0.3s ease forwards !important;
    transition: none !important;
}

@keyframes pageIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pageOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* ========== 子页面背景装饰层 ========== */
.bg-deco-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

/* ========== 子页面内容区 ========== */
.page-content {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding: 5rem 2rem 4rem;
    min-height: calc(100vh - 48px - 42px);
    z-index: 10;
    color: var(--text);
}

.page-content h1 {
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 1.8rem;
    font-weight: 900;
    color: #fff;
    margin-bottom: 1.5rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid var(--vbs);
}

.page-content p {
    line-height: 1.8;
    font-size: 0.95rem;
}

/* ========== 台词征集浮动入口 (默认样式) ========== */
.lines-float-entry {
    position: fixed;
    top: 120px;
    right: 4rem;
    z-index: 80;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 0.6rem 1rem;
    background: rgba(238,17,102,0.12);
    border: 1px solid rgba(238,17,102,0.35);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.8s ease, background 0.3s ease, border-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    animation: linesEntryPulse 3s ease-in-out infinite;
    opacity: 0;
}

.lines-float-entry.show {
    opacity: 1;
}

.lines-float-entry:hover {
    background: rgba(238,17,102,0.22);
    border-color: var(--vbs);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(238,17,102,0.25);
}

.lines-float-sparkle {
    font-size: 1rem;
    color: #fff; /* 改为白色 */
    animation: sparkleSpin 4s linear infinite;
}

.lines-float-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.05em;
}

.lines-float-sub {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.5);
}

@keyframes linesEntryPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(238,17,102,0); }
    50% { box-shadow: 0 0 12px 2px rgba(238,17,102,0.2); }
}

@keyframes sparkleSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========== 移动端适配 (max-width: 768px) ========== */
@media (max-width: 768px) {
    .top-strip { height: 56px; }
    .strip-trap { width: auto; padding: 0 1.5rem 0 1rem; clip-path: polygon(0 0, 100% 0, calc(100% - 20px) 100%, 0 100%); }
    .strip-title { font-size: 1.1rem; }
    .strip-right { padding: 0 1rem; justify-content: flex-end; }
    .strip-vbs { display: none; } /* 移动端隐藏 VBS 标志以节省空间 */
    
    /* 移动端汉堡菜单按钮显示 */
    .mobile-menu-btn { display: block; }
    
    /* 汉堡菜单动画 */
    .mobile-menu-btn.active span:nth-child(1) { transform: rotate(-45deg) translate(-5px, 5px); }
    .mobile-menu-btn.active span:nth-child(2) { opacity: 0; }
    .mobile-menu-btn.active span:nth-child(3) { transform: rotate(45deg) translate(-5px, -5px); }

    /* 弹出式导航栏 */
    .strip-nav { 
        position: fixed;
        top: 56px;
        right: -100%;
        width: 60%;
        max-width: 250px;
        height: calc(100vh - 56px);
        background: rgba(26, 26, 36, 0.95);
        backdrop-filter: blur(10px);
        flex-direction: column;
        align-items: flex-start;
        padding: 2rem 1.5rem;
        gap: 1.5rem;
        transition: right 0.3s ease;
        border-left: 1px solid rgba(238,17,102,0.3);
        box-shadow: -5px 0 15px rgba(0,0,0,0.5);
    }
    
    .strip-nav.active { right: 0; }
    
    .nav-link { font-size: 1.1rem; width: 100%; padding-bottom: 0.5rem; border-bottom: 1px solid rgba(255,255,255,0.1); }
    
    .kv { padding-top: 56px; } /* 适应变高的顶部导航 */
    
    .kv-title {
        padding-top: 0; /* 移除顶部内边距 */
        top: 56px; /* 强制设置 top 为导航栏的高度 */
        position: fixed; /* 改为 fixed 定位，确保它始终在导航栏下方 */
        z-index: 90; /* 确保在角色之上，但在导航栏之下 */
    }
    .kv-title h1 { font-size: 1.8rem; margin-top: 0.2rem; } /* 微调标题上边距 */
    .kv-sub { font-size: 0.6rem; }
    
    /* 移动端将左右信息块移到底部或重新排版 */
    .side-info { 
        position: absolute; 
        left: 50%; 
        top: auto; 
        bottom: 130px; /* 上调位置，避免与下方按钮重叠 */
        transform: translateX(-50%) !important; 
        flex-direction: row; 
        width: 90%; 
        justify-content: center; /* 居中对齐 */
        gap: 1rem;
        padding: 0.5rem 1rem;
        background: rgba(238, 17, 102, 0.6); /* 增加不透明度 */
        backdrop-filter: blur(4px);
        border-radius: 20px; /* 圆角更圆润 */
        z-index: 60; /* 确保在角色上方 */
    }
    .qr-placeholder { display: none; } /* 手机端隐藏二维码，保留群号 */
    .side-label { margin: 0; font-size: 0.8rem; }
    
    .kv-info { 
        position: absolute; 
        right: auto; 
        left: 50%; 
        top: auto; 
        bottom: 175px; /* 调整位置，使其在台词框和入群信息之间等距 */
        transform: translateX(-50%); 
        flex-direction: row; 
        width: 95%; 
        justify-content: center;
        gap: 1rem;
        background: transparent; /* 移除背景，使其更轻量 */
        padding: 0;
        backdrop-filter: none;
        pointer-events: none; /* 避免遮挡点击 */
    }
    .kv-info-item { 
        flex-direction: column; 
        gap: 0.1rem; 
        align-items: center;
        text-shadow: 0 2px 4px rgba(0,0,0,0.8); /* 增加文字阴影以提高可读性 */
    }
    .kv-info-item .label {
        font-size: 0.65rem;
        padding: 0.1rem 0.4rem;
        background: rgba(238,17,102,0.8);
        border-radius: 4px;
    }
    .kv-info-item .value {
        font-size: 0.85rem;
    }
    
    /* 移动端角色滑动轮播样式 */
    .kv-chars {
        justify-content: flex-start;
        padding-top: 0;
        overflow: visible; /* 移除 hidden，防止角色头部或对话框被截断 */
        position: absolute; /* 改为绝对定位，以便精确控制底部位置 */
        bottom: 42px; /* 贴在页脚上方 (页脚高度是 42px) */
        left: 0;
        width: 100%;
        height: 75%; /* 稍微减小高度，让立绘整体下移一点 */
        z-index: 10; /* 确保在背景之上 */
    }
    
    .kv-chars.is-mobile-slider {
        display: block; /* 改为 block 以支持绝对定位叠加 */
    }
    
    .kv-chars.is-mobile-slider .char-wrap {
        position: absolute; /* 绝对定位实现重叠 */
        bottom: 0; /* 贴底 */
        left: 0;
        width: 100%; /* 占满宽度 */
        height: 100%; /* 占满容器高度 */
        margin: 0;
        opacity: 0; /* 默认隐藏 */
        transition: opacity 0.8s ease; /* 淡入淡出效果 */
        z-index: 1 !important;
        display: flex;
        justify-content: center;
        align-items: flex-end; /* 底部对齐 */
        pointer-events: none; /* 默认不响应点击 */
        padding-bottom: 0; /* 移除底部留白，让立绘贴底 */
    }
    
    .kv-chars.is-mobile-slider .char-wrap.slider-active {
        opacity: 1; /* 激活显示 */
        z-index: 10 !important;
        pointer-events: auto; /* 激活响应点击 */
    }
    
    .kv-chars.is-mobile-slider .char-wrap img {
        transform: scale(1.1) !important; /* 进一步减小放大倍数，避免超出屏幕 */
        transform-origin: bottom center !important; /* 从底部中心放大 */
        max-height: 100%; /* 允许占满容器高度 */
        width: auto;
        max-width: none; /* 移除最大宽度限制，允许自由放大 */
        object-fit: contain;
        object-position: bottom center; /* 底部居中对齐 */
        filter: drop-shadow(0 2px 8px rgba(0,0,0,0.6)); /* 简化阴影 */
    }
    /* 单独调整各角色的位置 */
    /* an 是第2个 (第1个是 kv-title) */
    .kv-chars.is-mobile-slider .char-wrap:nth-child(2) img { 
        transform: scale(1.15) translateY(10) !important; 
        transform-origin: bottom center !important; 
    }
    /* khn 是第3个 */
    .kv-chars.is-mobile-slider .char-wrap:nth-child(3) img { 
        transform: scale(1.15) translateY(10) !important; 
        transform-origin: bottom center !important; 
    }
    /* miku 是第4个 */
    .kv-chars.is-mobile-slider .char-wrap:nth-child(4) img { 
        transform: scale(1.15) translateY(10) !important; 
        transform-origin: bottom center !important; 
    }
    /* akt 是第5个 */
    .kv-chars.is-mobile-slider .char-wrap:nth-child(5) img { 
        transform: scale(1.1) translateY(30px) !important; /* 向下偏移 90px，保持与全局一致的缩放比例 */
        transform-origin: bottom center !important; 
    }
    /* toya 是第6个 */
    .kv-chars.is-mobile-slider .char-wrap:nth-child(6) img { 
        transform: scale(1.1) translateY(30px) !important; /* 向下偏移 90px，保持与全局一致的缩放比例 */
        transform-origin: bottom center !important; 
    }
    
    /* 移动端彻底隐藏剪影特效 */
    .char-shadow {
        display: none !important;
    }
    
    /* 移动端对话框固定在角色上方 */
    .char-quote {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
        bottom: 230px; /* 固定在底部，位于三个标签上方 */
        top: auto !important; /* 覆盖默认的 top */
        margin-bottom: 0;
        transform: translateX(-50%) translateY(20px) !important; /* 初始状态：向下偏移并居中 */
        opacity: 0 !important; /* 初始状态：透明 */
        visibility: visible !important; /* 确保可见 */
        white-space: normal; /* 允许换行 */
        width: max-content;
        max-width: 80vw;
        text-align: center;
        z-index: 30; /* 提高层级 */
        position: fixed; /* 改为 fixed 定位，脱离角色容器的限制 */
        left: 50%;
        transition: opacity 0.5s ease 0.3s, transform 0.5s ease 0.3s !important; /* 延迟 0.3s 出现 */
    }
    
    /* 激活时的状态 */
    .char-wrap.active .char-quote,
    .char-wrap.slider-active .char-quote {
        transform: translateX(-50%) translateY(0) !important; /* 回到原位 */
        opacity: 1 !important; /* 显示 */
    }
    
    .slider-dots { display: none !important; } /* 彻底隐藏移动端滑动指示器 */
    
    .bg-title { 
        font-size: 1.8rem; 
        bottom: auto; /* 移除底部定位 */
        top: 50%; /* 垂直居中 */
        transform: translate(-50%, -50%); /* 水平和垂直同时居中 */
        opacity: 0.5; 
    }
    
    .lines-float-entry { 
        top: auto; 
        bottom: 60px; 
        right: 50%; 
        transform: translateX(50%); /* 居中显示 */
        width: auto;
        min-width: 160px;
        flex-direction: row;
        justify-content: center;
        background: rgba(238,17,102,0.85); /* 更显眼的背景 */
        border-color: rgba(255,255,255,0.3);
    }
    .lines-float-entry:hover { transform: translateX(50%) translateY(-2px); }
    .lines-float-sub { display: none; } /* 隐藏副标题 */
}

/* 针对高度较小的横屏浏览器（如笔记本或平板横屏） */
@media (max-height: 700px) and (min-width: 769px) {
    .lines-float-entry {
        top: auto;
        bottom: 60px; /* 改为底部定位 */
        right: 2rem; /* 靠右一些，与下方信息对齐 */
        flex-direction: row; /* 改为横向排列节省高度 */
        padding: 0.4rem 0.8rem;
        gap: 8px;
    }
    .lines-float-label {
        font-size: 0.75rem;
    }
    .lines-float-sub {
        display: none; /* 隐藏副标题节省空间 */
    }

    /* 左侧信息板块紧凑化 */
    .side-info {
        left: 2rem; /* 靠边一些 */
        padding: 0.5rem 0.8rem;
        gap: 0.4rem;
        transform: translateY(-50%) scale(0.9); /* 整体缩小 */
    }
    .qr-placeholder {
        width: 90px; /* 缩小二维码 */
        height: 90px;
    }
    .side-link {
        font-size: 0.95rem;
    }

    /* 右侧信息板块紧凑化 */
    .kv-info {
        right: 2rem; /* 靠边一些 */
        gap: 0.8rem; /* 减小间距 */
        transform: translateY(-50%) scale(0.9); /* 整体缩小 */
    }
    .kv-info-item .label {
        font-size: 0.7rem;
        padding: 0.15rem 0.4rem;
    }
    .kv-info-item .value {
        font-size: 0.9rem;
    }
}