/* ========== CSS Variables - Cute Theme ========== */
:root {
    --pink: #ff7eb3;
    --pink-light: #ffb6d3;
    --purple: #c084fc;
    --purple-light: #e0b0ff;
    --blue: #7dd3fc;
    --blue-light: #bae6fd;
    --bg: #fff5f9;
    --bg-card: #ffffff;
    --bg-card-hover: #fff0f5;
    --text: #4a3055;
    --text-light: #8b6b9e;
    --text-muted: #b8a0c8;
    --border: #f0d5e8;
    --border-focus: #ff7eb3;
    --shadow-sm: 0 2px 8px rgba(255, 126, 179, 0.15);
    --shadow-md: 0 4px 16px rgba(255, 126, 179, 0.2);
    --shadow-lg: 0 8px 32px rgba(192, 132, 252, 0.25);
    --shadow-glow: 0 0 30px rgba(255, 126, 179, 0.3);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-full: 9999px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== Base Reset ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Hiragino Sans GB', 'Comic Sans MS', cursive, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    overflow-x: hidden;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #fce4ec; }
::-webkit-scrollbar-thumb { background: var(--pink-light); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--pink); }

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========== Laser Rain Canvas ========== */
#laser-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ========== Navigation ========== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 245, 249, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    transition: all var(--transition);
}

.navbar.scrolled {
    background: rgba(255, 245, 249, 0.95);
    box-shadow: var(--shadow-md);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.logo {
    font-size: 1.3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--pink), var(--purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 28px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-light);
    font-size: 0.95rem;
    font-weight: 500;
    transition: color var(--transition);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, var(--pink), var(--purple));
    border-radius: var(--radius-full);
    transition: width var(--transition);
}

.nav-links a:hover { color: var(--pink); }
.nav-links a:hover::after { width: 100%; }

.mobile-menu-btn {
    display: none;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-light);
    transition: all var(--transition);
}

.mobile-menu-btn:hover {
    background: var(--bg-card);
    color: var(--pink);
}

/* ========== Carousel Section ========== */
.carousel-section {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 90px 20px 40px;
}

.carousel-wrapper {
    position: relative;
    width: 100%;
    max-width: 520px;
    aspect-ratio: 3 / 4;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    background: #fce4ec;
    padding: 0;
    overflow: hidden;
}

/* 彩虹边框 */
.carousel-wrapper::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: calc(var(--radius-xl) + 4px);
    background: linear-gradient(45deg, #ff7eb3, #c084fc, #7dd3fc, #fde68a, #a7f3d0, #fda4af, #ff7eb3);
    background-size: 400% 400%;
    z-index: -1;
    animation: rainbowMove 3s linear infinite;
}

@keyframes rainbowMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.carousel-track {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: var(--radius-xl);
    will-change: transform;
}

.carousel-track img {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    object-position: center;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.8);
    color: var(--pink);
    font-size: 1.3rem;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.carousel-btn:hover {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-md);
    transform: translateY(-50%) scale(1.1);
}

.carousel-btn.prev { left: 16px; }
.carousel-btn.next { right: 16px; }

.carousel-dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 2;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid rgba(255, 126, 179, 0.4);
    cursor: pointer;
    transition: all var(--transition);
}

.carousel-dot.active {
    background: var(--pink);
    border-color: var(--pink);
    box-shadow: 0 0 8px rgba(255, 126, 179, 0.5);
    transform: scale(1.2);
}

.carousel-title {
    text-align: center;
    margin-top: 32px;
    animation: fadeInUp 0.8s ease-out;
}

.carousel-title h1 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--pink), var(--purple), var(--blue), var(--pink));
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.carousel-title p {
    color: var(--text-light);
    font-size: 1.05rem;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ========== Section Common ========== */
.section {
    position: relative;
    z-index: 1;
    padding: 60px 0;
}

.section-title {
    text-align: center;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 40px;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background: linear-gradient(135deg, var(--pink), var(--purple));
    margin: 12px auto 0;
    border-radius: var(--radius-full);
}

/* ========== Message Form ========== */
.message-form {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 32px;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
}

.message-form:focus-within {
    border-color: var(--pink);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.message-form input,
.message-form textarea {
    width: 100%;
    padding: 14px 16px;
    background: #fef5f9;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 14px;
    font-family: inherit;
    transition: all var(--transition);
}

.message-form input::placeholder,
.message-form textarea::placeholder {
    color: var(--text-muted);
}

.message-form input:focus,
.message-form textarea:focus {
    outline: none;
    border-color: var(--pink);
    box-shadow: 0 0 0 4px rgba(255, 126, 179, 0.1);
    background: #fff;
}

.message-form textarea {
    resize: vertical;
    min-height: 100px;
}

.btn {
    padding: 12px 36px;
    border: none;
    border-radius: var(--radius-full);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--pink), var(--purple));
    color: #fff;
    box-shadow: 0 4px 16px rgba(255, 126, 179, 0.4);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(255, 126, 179, 0.5);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-primary.loading {
    position: relative;
    color: transparent;
}

.btn-primary.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ========== Messages List ========== */
.messages-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.message-card {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: all var(--transition);
    box-shadow: var(--shadow-sm);
    animation: fadeInUp 0.4s ease-out;
}

.message-card:hover {
    border-color: var(--pink-light);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    background: var(--bg-card-hover);
}

.message-card .msg-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.message-card .msg-nickname {
    font-weight: 600;
    color: var(--pink);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.message-card .msg-nickname::before {
    content: '🌸';
    font-size: 0.85rem;
}

.message-card .msg-time {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.message-card .msg-content {
    color: var(--text-light);
    font-size: 0.93rem;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}

.msg-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 50px 0;
    font-size: 0.95rem;
}

/* ========== Toast ========== */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 260px;
    max-width: 380px;
    animation: slideInRight 0.3s ease-out;
    box-shadow: var(--shadow-md);
}

.toast.success {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border: 1px solid #86efac;
    color: #166534;
}

.toast.error {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border: 1px solid #fca5a5;
    color: #991b1b;
}

.toast svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.toast.fade-out {
    animation: fadeOut 0.3s ease-in forwards;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(20px); }
}

/* ========== Audio Toggle ========== */
.audio-toggle {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 1500;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pink);
    transition: all var(--transition);
    box-shadow: var(--shadow-md);
}

.audio-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-glow);
}

.audio-toggle svg {
    width: 22px;
    height: 22px;
}

.audio-toggle.playing {
    background: linear-gradient(135deg, var(--pink), var(--purple));
    color: #fff;
    border-color: transparent;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 126, 179, 0.4); }
    50% { box-shadow: 0 0 0 12px rgba(255, 126, 179, 0); }
}

/* ========== Footer ========== */
.footer {
    position: relative;
    z-index: 1;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 28px 0;
    text-align: center;
}

.footer p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .container { padding: 0 16px; }
    .navbar .container { height: 56px; }

    .nav-links {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: rgba(255, 245, 249, 0.98);
        backdrop-filter: blur(20px);
        padding: 16px;
        flex-direction: column;
        gap: 12px;
        border-bottom: 1px solid var(--border);
    }

    .nav-links.active { display: flex; }
    .mobile-menu-btn { display: block; }

    .carousel-section {
        padding: 70px 12px 30px;
    }

    .carousel-wrapper {
        max-width: 100%;
        border-radius: var(--radius-lg);
        aspect-ratio: 3 / 4;
    }

    .carousel-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .carousel-btn.prev { left: 8px; }
    .carousel-btn.next { right: 8px; }

    .carousel-title h1 { font-size: 1.5rem; }

    .section { padding: 40px 0; }
    .section-title { font-size: 1.3rem; margin-bottom: 28px; }

    .message-form { padding: 20px; }
    .message-card { padding: 16px; }

    .toast-container { right: 12px; left: 12px; }
    .toast { min-width: auto; }

    .audio-toggle { bottom: 20px; right: 20px; }
}

@media (max-width: 480px) {
    .carousel-title h1 { font-size: 1.3rem; }
    .carousel-title p { font-size: 0.9rem; }
    .btn { width: 100%; }
    .carousel-dot { width: 8px; height: 8px; }
}
