* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="%23ffdfb0"><path d="M12 2L15 8.5L22 9.5L17 14L18.5 21L12 17.5L5.5 21L7 14L2 9.5L9 8.5L12 2Z"/></svg>') 12 12, auto;
}

body {
    background: radial-gradient(ellipse at 30% 40%, #0b0e2a, #020318);
    font-family: 'Segoe UI', 'Poppins', 'Quicksand', system-ui, -apple-system, 'Microsoft YaHei', sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
    transition: background 0.6s ease;
}
body.dawn-mode {
    background: radial-gradient(ellipse at 30% 40%, #ffe6dc, #ffd4c9, #ffecd6);
}

#bg-stars-canvas, #mouse-glow-canvas, #effect-canvas, #orbit-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
    z-index: 0;
}
#mouse-glow-canvas { z-index: 9999; }
#effect-canvas, #orbit-canvas { z-index: 10000; }

.home-container {
    position: relative;
    z-index: 2;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.welcome-card {
    position: relative;
    width: 100%;
    max-width: 520px;
    background: rgba(12, 18, 40, 0.75);
    backdrop-filter: blur(12px);
    border-radius: 2.5rem;
    padding: 2rem 1.8rem 2.5rem;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.3s;
    animation: cardGlow 3s infinite alternate;
    z-index: 10;
    border: 1px solid rgba(210, 180, 255, 0.45);
}
body.dawn-mode .welcome-card {
    background: rgba(45, 35, 55, 0.65);
    border-color: rgba(255, 220, 180, 0.6);
}
@keyframes cardGlow {
    0% { box-shadow: 0 0 10px rgba(100, 70, 200, 0.3), 0 30px 50px rgba(0,0,0,0.5); }
    100% { box-shadow: 0 0 30px rgba(180, 130, 255, 0.6), 0 30px 60px rgba(0,0,0,0.5); }
}

.greeting-icon {
    font-size: 3rem;
    filter: drop-shadow(0 0 8px #ffdfb0);
    margin-bottom: 0.5rem;
    animation: gentleFloat 3s ease-in-out infinite;
}
@keyframes gentleFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

.welcome-title {
    font-size: 2.3rem;
    font-weight: 500;
    background: linear-gradient(135deg, #fff3db, #d9bcff, #a0e9ff);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.sub-welcome {
    font-size: 0.85rem;
    color: #ccd6f0;
    border-bottom: 1px dashed rgba(200, 170, 250, 0.5);
    display: inline-block;
    padding-bottom: 4px;
    margin-bottom: 2rem;
    opacity: 0.8;
}

.avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1.8rem;
    position: relative;
}
.avatar-wrapper {
    position: relative;
    margin-bottom: 1rem;
}
.avatar-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: #1a1f3c;
    border: 3px solid #cfb5ff;
    box-shadow: 0 0 15px rgba(180, 130, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    transition: 0.2s;
    background-size: cover;
    background-position: center;
}
.avatar-preview:hover { transform: scale(1.02); border-color: #ffe0b3; }
.avatar-placeholder { font-size: 3rem; }
.avatar-img { width: 100%; height: 100%; object-fit: cover; }

.avatar-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120px;
    height: 120px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(255,215,0,0.3);
    animation: spinRing 8s linear infinite;
}
.avatar-ring::before, .avatar-ring::after {
    content: '✨';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    opacity: 0.8;
}
.avatar-ring::after { top: auto; bottom: -8px; }
@keyframes spinRing { 0% { transform: translate(-50%, -50%) rotate(0deg); } 100% { transform: translate(-50%, -50%) rotate(360deg); } }

.avatar-buttons { display: flex; gap: 12px; justify-content: center; margin-top: 8px; }
.mini-btn {
    background: rgba(35, 40, 80, 0.8);
    border: 1px solid #b79eff;
    color: #f0ebff;
    padding: 6px 16px;
    border-radius: 40px;
    font-size: 0.75rem;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: all 0.2s;
}
.mini-btn:hover {
    background: #5f4a9e;
    border-color: #ffdfb0;
    transform: translateY(-2px);
    box-shadow: 0 0 12px #b794ff;
}

.nickname-input {
    width: 100%;
    background: rgba(5, 8, 28, 0.7);
    border: 1px solid #9b87cf;
    border-radius: 60px;
    padding: 12px 20px;
    font-size: 1rem;
    color: #f0ecff;
    outline: none;
    text-align: center;
    transition: all 0.3s;
}
.nickname-input:focus {
    border-color: #efcdff;
    box-shadow: 0 0 20px #ab8eff;
}

.enter-btn {
    background: linear-gradient(95deg, #7b5dc9, #4f3a96);
    border: none;
    padding: 12px 28px;
    border-radius: 60px;
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff7e8;
    margin-top: 1.8rem;
    width: 80%;
    cursor: pointer;
    transition: 0.2s;
    letter-spacing: 2px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
}
.enter-btn:hover {
    transform: scale(0.97);
    background: linear-gradient(95deg, #9475e0, #6a4eb3);
    box-shadow: 0 0 18px #b794ff;
}

.particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10001;
}

.footer-note {
    font-size: 0.7rem;
    margin-top: 1.5rem;
    opacity: 0.7;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #b7adf0;
}

.theme-switch {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(30,25,65,0.8);
    backdrop-filter: blur(8px);
    border-radius: 40px;
    padding: 8px 16px;
    font-size: 0.75rem;
    color: #f0ebff;
    border: 1px solid #b397ef;
    cursor: pointer;
    z-index: 100;
    transition: 0.2s;
}
.theme-switch:hover {
    background: #5d489b;
    transform: scale(0.96);
}

.my-memories-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(30,25,65,0.8);
    backdrop-filter: blur(8px);
    border-radius: 40px;
    padding: 8px 16px;
    font-size: 0.75rem;
    color: #f0ebff;
    border: 1px solid #b397ef;
    cursor: pointer;
    z-index: 100;
    transition: 0.2s;
}
.my-memories-btn:hover {
    background: #5d489b;
}

.modal-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: 0.2s;
}
.modal-mask.active {
    visibility: visible;
    opacity: 1;
}
.modal-card {
    background: rgba(18,22,48,0.95);
    border-radius: 2rem;
    border: 1px solid #c7adff;
    width: 85%;
    max-width: 400px;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 1rem;
}
.modal-title {
    padding: 0.5rem;
    text-align: center;
    font-weight: bold;
    background: linear-gradient(135deg, #ffe5c4, #d9bcff);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}
.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    color: #e2dcff;
}
.history-item {
    background: rgba(45,48,85,0.6);
    margin: 8px 0;
    padding: 8px 12px;
    border-radius: 2rem;
    display: flex;
    align-items: center;
    gap: 12px;
}
.history-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #282e55;
    background-size: cover;
    background-position: center;
}
.modal-close {
    background: #6c52b0;
    border: none;
    border-radius: 40px;
    padding: 6px;
    color: white;
    margin-top: 12px;
    cursor: pointer;
}

.toast-msg {
    position: fixed;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(12px);
    color: #ffefcf;
    padding: 6px 20px;
    border-radius: 40px;
    font-size: 0.8rem;
    z-index: 10002;
    opacity: 0;
    transition: 0.2s;
    pointer-events: none;
    white-space: nowrap;
}
.toast-msg.show {
    opacity: 1;
}

@media (max-width: 500px) {
    .welcome-card { padding: 1.5rem; }
    .welcome-title { font-size: 1.9rem; }
    .enter-btn { width: 90%; font-size: 1rem; }
}