/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent; /* 禁止点击高亮 */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
    background-color: #f2f2f7; /* iOS 系统背景色 */
    color: #1c1c1e;
    line-height: 1.5;
    overflow-x: hidden;
}

#root {
    min-height: 100vh;
    padding-top: 0;
}

#root.route-exit {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

#root.route-enter {
    opacity: 0;
    transform: translateY(12px);
}

#root {
    transition: opacity 0.24s ease, transform 0.24s ease;
}

/* 顶部导航已移除 */

/* 简单的渐变入场动画 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* frontend/app.css */

/* 浪漫心跳闪烁背景 */
.effect-heart-flash {
    animation: heart-bg 1s ease;
}

@keyframes heart-bg {
    0% { background-color: transparent; }
    50% { background-color: rgba(255, 182, 193, 0.4); }
    100% { background-color: transparent; }
}

/* 樱花掉落动画 */
.flower-petal {
    position: fixed;
    top: -20px;
    pointer-events: none;
    z-index: 10000;
    animation: fall linear forwards;
}

@keyframes fall {
    to { transform: translateY(105vh) rotate(360deg); }
}

/* ===== Dark Mode Base ===== */

body {
    transition: background-color 0.35s ease, color 0.35s ease;
}

body[data-theme="dark"] {
    background-color: #1a1b18;
    color: #e8e4dc;
}

body[data-theme="dark"] #root {
    color: #e8e4dc;
}

/* ===== Theme Toggle Button (fixed position) ===== */

.theme-toggle {
    position: fixed;
    top: 70px;
    right: 45px;
    z-index: 9999;
    border: none;
    background: rgba(255, 255, 255, 0.82);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(44, 62, 56, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    color: #5a7068;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: scale(1.1);
    box-shadow: 0 4px 20px rgba(44, 62, 56, 0.18);
}

.theme-toggle:active {
    transform: scale(0.95);
}

body[data-theme="dark"] .theme-toggle {
    background: rgba(40, 42, 38, 0.82);
    color: #e8e4dc;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

body[data-theme="dark"] .theme-toggle:hover {
    background: rgba(50, 52, 48, 0.95);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}
