/* ==================== 全局重置与浪漫粉彩风格 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 浅色浪漫模式 */
    --bg-image: url('https://www.oao.cc/upload/202602-XUax.webp');
    --bg-overlay: rgba(255, 182, 193, 0.4); /* 粉红遮罩 */
    --card-bg: rgba(255, 240, 245, 0.65);
    --card-border: rgba(255, 182, 193, 0.6);
    --text-primary: #5b3a4a;
    --text-secondary: #a06b7a;
    --accent: #ff6b9d;
    --accent2: #ff8fab;
    --gold: #ffb6c1;
    --shadow: 0 15px 35px rgba(255, 105, 180, 0.25);
    --button-bg: rgba(255, 240, 245, 0.8);
    --button-border: rgba(255, 182, 193, 0.6);
    --particle-color: #ff6b9d;
    --heart-glow: 0 0 20px rgba(255, 105, 180, 0.6);
}

/* 深色浪漫模式（自动） */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-image: url('https://www.oao.cc/upload/202602-XUax.webp');
        --bg-overlay: rgba(40, 10, 20, 0.6); /* 深色遮罩，保留背景 */
        --card-bg: rgba(50, 20, 30, 0.65);
        --card-border: rgba(255, 105, 180, 0.4);
        --text-primary: #ffe4ec;
        --text-secondary: #e0a0b0;
        --accent: #ff8fab;
        --accent2: #ffb6c1;
        --gold: #ffb6c1;
        --shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
        --button-bg: rgba(50, 20, 30, 0.8);
        --button-border: rgba(255, 105, 180, 0.4);
        --particle-color: #ff8fab;
        --heart-glow: 0 0 20px rgba(255, 105, 180, 0.8);
    }
}

/* 手动浅色浪漫 */
[data-theme="light"] {
    --bg-image: url('https://www.oao.cc/upload/202602-XUax.webp');
    --bg-overlay: rgba(255, 182, 193, 0.4);
    --card-bg: rgba(255, 240, 245, 0.65);
    --card-border: rgba(255, 182, 193, 0.6);
    --text-primary: #5b3a4a;
    --text-secondary: #a06b7a;
    --accent: #ff6b9d;
    --accent2: #ff8fab;
    --gold: #ffb6c1;
    --shadow: 0 15px 35px rgba(255, 105, 180, 0.25);
    --button-bg: rgba(255, 240, 245, 0.8);
    --button-border: rgba(255, 182, 193, 0.6);
    --particle-color: #ff6b9d;
    --heart-glow: 0 0 20px rgba(255, 105, 180, 0.6);
}

/* 手动深色浪漫 */
[data-theme="dark"] {
    --bg-image: url('https://www.oao.cc/upload/202602-XUax.webp');
    --bg-overlay: rgba(40, 10, 20, 0.6);
    --card-bg: rgba(50, 20, 30, 0.65);
    --card-border: rgba(255, 105, 180, 0.4);
    --text-primary: #ffe4ec;
    --text-secondary: #e0a0b0;
    --accent: #ff8fab;
    --accent2: #ffb6c1;
    --gold: #ffb6c1;
    --shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    --button-bg: rgba(50, 20, 30, 0.8);
    --button-border: rgba(255, 105, 180, 0.4);
    --particle-color: #ff8fab;
    --heart-glow: 0 0 20px rgba(255, 105, 180, 0.8);
}

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Georgia', 'PingFang SC', 'Microsoft YaHei', '楷体', cursive;
    background-color: #fce4ec; /* fallback */
    background-image: var(--bg-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    user-select: none;
    -webkit-user-select: none;
    cursor: default;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.3s ease, color 0.3s ease;
    position: relative;
}

/* 粉红遮罩层，增强浪漫氛围 */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-overlay);
    pointer-events: none;
    z-index: 0;
    transition: background-color 0.3s ease;
}

/* 主题切换按钮 */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    background: var(--button-bg);
    border: 1px solid var(--button-border);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: all 0.3s;
}
.theme-toggle:hover {
    transform: scale(1.1);
}

/* 粒子容器 */
#particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    pointer-events: none;
    animation: particleFloat 1.2s ease-out forwards;
    font-size: 18px;
    color: var(--particle-color);
    text-shadow: var(--heart-glow);
}

@keyframes particleFloat {
    0% { transform: translate(0,0) scale(0.5) rotate(0deg); opacity: 1; }
    100% { transform: translate(var(--dx), var(--dy)) scale(1.5) rotate(180deg); opacity: 0; }
}

/* 主卡片（浪漫毛玻璃） */
.main-card {
    position: relative;
    z-index: 10;
    width: 90%;
    max-width: 420px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 30px; /* 更圆润 */
    padding: 35px 25px 30px;
    text-align: center;
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: background 0.3s ease, border-color 0.3s ease;
}

/* 添加心形装饰（卡片角落） */
.main-card::before,
.main-card::after {
    content: '❤';
    position: absolute;
    font-size: 28px;
    color: var(--accent);
    opacity: 0.3;
    pointer-events: none;
    animation: floatHeart 3s ease-in-out infinite;
}
.main-card::before {
    top: -15px;
    left: 15px;
}
.main-card::after {
    bottom: -15px;
    right: 15px;
    animation-delay: 1.5s;
}

@keyframes floatHeart {
    0%, 100% { transform: translateY(0); opacity: 0.3; }
    50% { transform: translateY(-10px); opacity: 0.6; }
}

/* 头像区域 */
.avatars {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
}

.avatar-box {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid var(--accent);
    box-shadow: 0 0 20px rgba(255, 105, 180, 0.5);
    object-fit: cover;
    transition: transform 0.3s;
    cursor: pointer;
}
.avatar:hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(255, 105, 180, 0.8);
}

.avatar-name {
    margin-top: 8px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.heart {
    font-size: 32px;
    color: var(--accent);
    animation: heartbeat 1.5s ease-in-out infinite;
    cursor: pointer;
    transition: transform 0.3s;
    text-shadow: var(--heart-glow);
}
.heart:hover {
    transform: scale(1.3);
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    10% { transform: scale(1.15); }
    20% { transform: scale(1.05); }
    30% { transform: scale(1.2); }
    45% { transform: scale(1); }
    60% { transform: scale(1.1); }
    75% { transform: scale(1); }
}

/* 名字区域 */
.names {
    font-size: 36px;
    font-weight: 700;
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 5px;
}

.name {
    cursor: pointer;
    transition: color 0.3s, text-shadow 0.3s;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
}
.name:hover {
    filter: brightness(1.2);
}

.and {
    font-size: 28px;
    color: var(--gold);
    -webkit-text-fill-color: initial;
}

.since {
    font-size: 14px;
    color: var(--text-secondary);
    letter-spacing: 2px;
    margin-bottom: 20px;
    border-bottom: 1px dashed var(--card-border);
    padding-bottom: 15px;
}

/* 计时器 */
.timer {
    margin-bottom: 20px;
}

.timer-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.timer-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.time-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 50px;
}

.time-unit span:first-child {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.unit-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.colon {
    font-size: 28px;
    color: var(--accent);
    padding-bottom: 10px;
    opacity: 0.8;
}

/* 天数特殊样式 */
.time-unit:first-child span:first-child {
    color: var(--accent);
}

.total-days {
    margin-top: 10px;
    font-size: 14px;
    color: var(--text-secondary);
}
.total-days span {
    font-weight: 700;
    color: var(--accent);
    font-size: 18px;
}

/* 文案轮播 */
.quotes {
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    position: relative;
}

.quote {
    font-size: 16px;
    color: var(--text-secondary);
    letter-spacing: 1px;
    opacity: 0;
    transition: opacity 0.8s;
    position: absolute;
    width: 100%;
    text-align: center;
    pointer-events: none;
}
.quote.active {
    opacity: 1;
}

/* 提示文字 */
.hint {
    font-size: 12px;
    color: var(--text-secondary);
    opacity: 0.5;
    letter-spacing: 1px;
}

/* 响应式 */
@media (max-width: 480px) {
    .main-card {
        padding: 25px 15px 20px;
        border-radius: 25px;
    }
    .avatar {
        width: 80px;
        height: 80px;
    }
    .names {
        font-size: 28px;
    }
    .time-unit span:first-child {
        font-size: 26px;
    }
    .colon {
        font-size: 22px;
    }
    .theme-toggle {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    .main-card::before,
    .main-card::after {
        font-size: 20px;
    }
}

/* 减少动画 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}