/* ===== KidsHub 选择用户页样式 ===== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    overflow: hidden;
    background: #05060f;
}

/* ===== 左右分屏容器 ===== */
.split {
    display: flex;
    width: 100%;
    height: 100%;
    position: relative;
}

/* ===== 单侧 ===== */
.side {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #fff;
    position: relative;
    overflow: hidden;
    transition: flex 0.6s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.5s ease, filter 0.5s ease;
}

.side-magic {
    color: #5c1f30;
    background:
        radial-gradient(ellipse at 70% 15%, rgba(255, 255, 255, 0.35) 0%, transparent 45%),
        radial-gradient(ellipse at 25% 80%, rgba(255, 170, 190, 0.5) 0%, transparent 50%),
        radial-gradient(ellipse at 30% 20%, #ffe2e9 0%, #ffb9c6 45%, #ff9eb5 100%);
}

.side-space {
    background: radial-gradient(ellipse at 70% 25%, #14305e 0%, #0a1a3a 45%, #04070f 100%);
}

/* 两侧中间的分界线：极淡的柔光过渡，避免生硬分割 */
.split::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 160px;
    transform: translateX(-50%);
    background: linear-gradient(to right, transparent, rgba(255, 182, 193, 0.35), transparent);
    pointer-events: none;
    z-index: 2;
}

/* hover 激活：拉伸 + 提亮 */
.side.active {
    flex: 1.45;
    z-index: 3;
}

/* 非 hover 侧：静止变暗 */
.side.dimmed {
    opacity: 0.5;
    filter: saturate(0.65) brightness(0.75);
}

/* 点击进入：被选侧全屏化，另一侧收缩淡出 */
.split.has-entering .side:not(.entering) {
    flex-grow: 0;
    opacity: 0;
    pointer-events: none;
}

.side.entering {
    z-index: 30;
}

/* ===== 特效画布 ===== */
.fx-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* ===== 魔法阵（SVG）===== */
.magic-circle {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 700px;
    height: 700px;
    margin-left: -350px;
    margin-top: -350px;
    opacity: 0.5;
    pointer-events: none;
    z-index: 1;
    animation: spin 40s linear infinite;
}

.magic-circle .mc-ring {
    fill: none;
    stroke: #ff8fab;
    stroke-width: 1;
}

.magic-circle .mc-tick {
    fill: none;
    stroke: #ff9eb5;
    stroke-width: 2;
}

.magic-circle .mc-star polygon {
    fill: none;
    stroke: #ffb6c1;
    stroke-width: 1;
}

.magic-circle .mc-dots circle {
    fill: #ff7a9e;
}

.magic-circle .mc-inner {
    fill: none;
    stroke: #ffb6c1;
    stroke-width: 1;
    opacity: 0.8;
}

.magic-circle .mc-core {
    fill: #fff;
    opacity: 0.9;
}

/* 内圈刻度环 */
.magic-circle .tick-2 {
    fill: none;
    stroke: #ffc0cb;
    stroke-width: 1;
}

/* 放射线 */
.magic-circle .mc-rays line {
    stroke: #ffb6c1;
    stroke-width: 1;
}

/* 纹路闪光动画 */
@keyframes mc-breathe {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}
@keyframes mc-sparkle {
    0%, 100% { opacity: 0.3; transform: scale(0.7); }
    50% { opacity: 1; transform: scale(1.2); }
}
@keyframes mc-flow {
    to { stroke-dashoffset: -240; }
}

.magic-circle .mc-ring {
    animation: mc-breathe 3.5s ease-in-out infinite;
}
.magic-circle .mc-star polygon {
    animation: mc-breathe 2.6s ease-in-out infinite;
}
.magic-circle .mc-rays line {
    animation: mc-breathe 4.2s ease-in-out infinite;
}
.magic-circle .mc-dots circle {
    transform-box: fill-box;
    transform-origin: center;
    animation: mc-sparkle 1.8s ease-in-out infinite;
}
.magic-circle .mc-tick {
    animation: mc-flow 6s linear infinite;
}
.magic-circle .tick-2 {
    animation: mc-flow 9s linear infinite;
}

/* 扫光亮弧：一道白光沿环快速扫过 */
@keyframes mc-sweep-flow {
    to { stroke-dashoffset: -600; }
}
.magic-circle .mc-sweep {
    fill: none;
    stroke: #ffffff;
    stroke-width: 2.5;
    stroke-linecap: round;
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.95));
    animation: mc-sweep-flow 3.2s linear infinite;
}
.magic-circle .sweep-1 {
    stroke-dasharray: 40 513;
}
.magic-circle .sweep-2 {
    stroke: #fff5f8;
    stroke-width: 2;
    stroke-dasharray: 30 347;
    animation-duration: 2.4s;
}
.magic-circle .sweep-3 {
    stroke: #ffe9ef;
    stroke-width: 1.8;
    stroke-dasharray: 24 278;
    animation-duration: 1.8s;
}

.side.active .magic-circle {
    opacity: 0.65;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 进入过渡：魔法阵放大 → 纹路快速逐条点亮 → 最亮 → 破碎 */
.magic-circle.boom {
    animation: mc-zoom 1.3s ease-out forwards, mc-flash 0.45s ease-out 0.8s forwards;
}
@keyframes mc-zoom {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.6); opacity: 1; }
}
@keyframes mc-flash {
    0% { filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.6)); }
    100% { filter: drop-shadow(0 0 70px rgba(255, 255, 255, 1)); }
}

@keyframes mc-lightup {
    0% { opacity: 0.08; }
    100% { opacity: 1; filter: drop-shadow(0 0 7px rgba(255, 255, 255, 0.95)); }
}

.magic-circle.boom .mc-tick,
.magic-circle.boom .tick-2,
.magic-circle.boom .mc-ring,
.magic-circle.boom .mc-star polygon,
.magic-circle.boom .mc-rays line,
.magic-circle.boom .mc-dots circle,
.magic-circle.boom .mc-inner,
.magic-circle.boom .mc-core {
    animation: mc-lightup 0.22s ease-out both;
}

/* 快速逐条点亮（外圈 → 六芒星 → 放射线 → 节点 → 内圈 → 核心），约 0.87s 全部点亮 */
.magic-circle.boom .mc-tick { animation-delay: 0s; }
.magic-circle.boom .tick-2 { animation-delay: 0.03s; }
.magic-circle.boom .mc-ring:nth-of-type(3) { animation-delay: 0.06s; }
.magic-circle.boom .mc-ring:nth-of-type(4) { animation-delay: 0.09s; }
.magic-circle.boom .mc-ring:nth-of-type(5) { animation-delay: 0.12s; }
.magic-circle.boom .mc-star polygon:nth-child(1) { animation-delay: 0.15s; }
.magic-circle.boom .mc-star polygon:nth-child(2) { animation-delay: 0.18s; }
.magic-circle.boom .mc-rays line:nth-child(1) { animation-delay: 0.20s; }
.magic-circle.boom .mc-rays line:nth-child(2) { animation-delay: 0.23s; }
.magic-circle.boom .mc-rays line:nth-child(3) { animation-delay: 0.26s; }
.magic-circle.boom .mc-rays line:nth-child(4) { animation-delay: 0.29s; }
.magic-circle.boom .mc-rays line:nth-child(5) { animation-delay: 0.32s; }
.magic-circle.boom .mc-rays line:nth-child(6) { animation-delay: 0.35s; }
.magic-circle.boom .mc-dots circle:nth-child(1) { animation-delay: 0.38s; }
.magic-circle.boom .mc-dots circle:nth-child(2) { animation-delay: 0.41s; }
.magic-circle.boom .mc-dots circle:nth-child(3) { animation-delay: 0.44s; }
.magic-circle.boom .mc-dots circle:nth-child(4) { animation-delay: 0.47s; }
.magic-circle.boom .mc-dots circle:nth-child(5) { animation-delay: 0.50s; }
.magic-circle.boom .mc-dots circle:nth-child(6) { animation-delay: 0.53s; }
.magic-circle.boom .mc-ring:nth-of-type(6) { animation-delay: 0.56s; }
.magic-circle.boom .mc-inner { animation-delay: 0.59s; }
.magic-circle.boom .mc-ring:nth-of-type(7) { animation-delay: 0.62s; }
.magic-circle.boom .mc-core { animation-delay: 0.65s; }

/* ===== 内容 ===== */
.side-inner {
    text-align: center;
    user-select: none;
    position: relative;
    z-index: 2;
}

.avatar {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    font-weight: 500;
    margin: 0 auto 1.3rem;
    border: 2px solid rgba(255, 255, 255, 0.45);
    box-shadow: 0 0 24px rgba(255, 255, 255, 0.15);
}

.avatar-magic {
    background: rgba(255, 150, 180, 0.4);
}

.avatar-space {
    background: rgba(55, 138, 221, 0.35);
}

.side-inner h1 {
    font-size: 2.8rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    transition: text-shadow 0.5s ease;
}

.side-inner p {
    margin-top: 0.7rem;
    font-size: 1.2rem;
    letter-spacing: 0.2em;
    opacity: 0.85;
}

/* 标题光晕 */
.side-magic .side-inner h1 {
    text-shadow: 0 2px 10px rgba(255, 255, 255, 0.55), 0 0 20px rgba(255, 224, 232, 0.65);
}
.side-magic.active .side-inner h1 {
    text-shadow: 0 2px 12px rgba(255, 255, 255, 0.75), 0 0 34px rgba(255, 224, 232, 0.85);
}

.side-space .side-inner h1 {
    text-shadow: 0 0 18px rgba(133, 183, 235, 0.35);
}
.side-space.active .side-inner h1 {
    text-shadow: 0 0 42px rgba(133, 183, 235, 0.85), 0 0 12px rgba(181, 212, 244, 0.6);
}

/* ===== 过渡遮罩（穿越白闪）===== */
.transition-overlay {
    position: fixed;
    inset: 0;
    background: #fff;
    opacity: 0;
    pointer-events: none;
    z-index: 50;
    transition: opacity 0.3s ease;
}

.transition-overlay.show {
    opacity: 1;
}

/* ===== 窄屏（平板竖屏）：上下分屏 ===== */
@media (max-width: 820px) {
    .split {
        flex-direction: column;
    }

    .split::after {
        left: 0;
        right: 0;
        top: 50%;
        bottom: auto;
        width: auto;
        height: 120px;
        transform: translateY(-50%);
        background: linear-gradient(to bottom, transparent, rgba(120, 90, 160, 0.25), transparent);
    }

    .side-inner h1 {
        font-size: 2.2rem;
    }

    .magic-circle {
        width: 420px;
        height: 420px;
        margin-left: -210px;
        margin-top: -210px;
    }
}
