:root, [data-theme="dark"] {
    --bg-gradient: linear-gradient(135deg, #232526 0%, #414345 100%);
    --container-bg: rgba(44, 62, 80, 0.97);
    --text-color: #ecf0f1;
    --h1-color: #ff7675;
    --h1-shadow: 0 2px 8px rgba(0,0,0,0.18), 0 0px 16px #ff767544;
    --p-color: #dfe6e9;
    --copyright-color: #b2bec3;
    --copyright-border: #636e72;
    --button-bg: linear-gradient(90deg, #ff7675 0%, #74b9ff 100%);
    --button-bg-hover: linear-gradient(90deg, #74b9ff 0%, #ff7675 100%);
    --button-color: #fff;
    --card-bg: var(--button-bg);
}
[data-theme="light"] {
    --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --container-bg: rgba(255,255,255,0.95);
    --text-color: #2d3436;
    --h1-color: #d63031;
    --h1-shadow: 0 2px 8px rgba(220, 220, 220, 0.18), 0 0px 16px #d6303144;
    --p-color: #636e72;
    --copyright-color: #636e72;
    --copyright-border: #b2bec3;
    --button-bg: linear-gradient(90deg, #74b9ff 0%, #fdcb6e 100%);
    --button-bg-hover: linear-gradient(90deg, #fdcb6e 0%, #74b9ff 100%);
    --button-color: #2d3436;
    --card-bg: var(--button-bg);
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: var(--bg-gradient);
    color: var(--text-color);
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    transition: background 0.5s cubic-bezier(.4,0,.2,1), color 0.5s cubic-bezier(.4,0,.2,1);
}

body.theme-fade {
    animation: theme-fade-in 0.6s cubic-bezier(.4,0,.2,1);
}
@keyframes theme-fade-in {
    from { opacity: 0.4; }
    to { opacity: 1; }
}

.container {
    background: var(--card-bg);
    padding: 48px 36px 24px 36px;
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37), 0 1.5px 8px 0 rgba(0,0,0,0.15);
    text-align: center;
    min-width: 340px;
    max-width: 92vw;
    position: relative;
    z-index: 10;
    opacity: 1;
    transition: box-shadow 0.3s, background 0.5s cubic-bezier(.4,0,.2,1);
    color: var(--button-color);
    animation: card-float 4s ease-in-out infinite alternate;
    will-change: transform, box-shadow;
    /* 亚克力效果优化 */
    backdrop-filter: blur(16px) saturate(120%);
    -webkit-backdrop-filter: blur(16px) saturate(120%);
    background-blend-mode: lighten;
    background-color: rgba(255,255,255,0.18); /* 降低透明度 */
}

@keyframes card-float {
    0% {
        transform: translateY(0px) scale(1) rotate(-1deg);
        box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37), 0 1.5px 8px 0 rgba(0,0,0,0.15);
    }
    30% {
        transform: translateY(-8px) scale(1.01) rotate(1deg);
        box-shadow: 0 16px 40px 0 rgba(31, 38, 135, 0.25), 0 2px 12px 0 rgba(0,0,0,0.13);
    }
    60% {
        transform: translateY(6px) scale(0.99) rotate(-2deg);
        box-shadow: 0 4px 16px 0 rgba(31, 38, 135, 0.18), 0 1px 6px 0 rgba(0,0,0,0.10);
    }
    100% {
        transform: translateY(0px) scale(1) rotate(0deg);
        box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37), 0 1.5px 8px 0 rgba(0,0,0,0.15);
    }
}

/* 鼠标悬停时平滑停止浮动动画 */
.container:hover, .container:focus-within {
    animation-play-state: paused;
    transition: transform 0.4s cubic-bezier(.4,0,.2,1), box-shadow 0.4s cubic-bezier(.4,0,.2,1);
    /* 保持最后动画状态 */
}

.container:hover {
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.45), 0 2px 12px 0 rgba(0,0,0,0.18);
}

h1 {
    font-size: 2.8em;
    margin-bottom: 0.6em;
    letter-spacing: 2px;
    color: var(--button-color);
    text-shadow: var(--h1-shadow);
    font-weight: 700;
    transition: color 0.5s cubic-bezier(.4,0,.2,1), text-shadow 0.5s cubic-bezier(.4,0,.2,1);
}

p {
    font-size: 1.25em;
    margin-bottom: 2em;
    color: var(--button-color);
    line-height: 1.7;
    text-shadow: 0 1px 4px rgba(0,0,0,0.08);
    transition: color 0.5s cubic-bezier(.4,0,.2,1), text-shadow 0.5s cubic-bezier(.4,0,.2,1);
}

.copyright {
    margin-top: 2em;
    font-size: 1em;
    color: var(--button-color);
    letter-spacing: 1px;
    border-top: 1px solid rgba(255,255,255,0.2);
    padding-top: 1em;
    text-align: center;
    opacity: 0.8;
    background: transparent;
    transition: color 0.5s cubic-bezier(.4,0,.2,1), text-shadow 0.5s cubic-bezier(.4,0,.2,1);
}

.actions {
    margin-bottom: 1.5em;
    display: flex;
    justify-content: center;
    gap: 1.2em;
    flex-wrap: wrap;
}

.actions button {
    background: var(--button-bg);
    color: var(--button-color);
    border: none;
    border-radius: 8px;
    padding: 0.7em 1.6em;
    font-size: 1em;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(31,38,135,0.12);
    outline: none;
    position: relative;
    overflow: hidden;
    /* 移除悬停颜色变化动画 */
    transition: 
        color 0.3s cubic-bezier(.4,0,.2,1), 
        transform 0.15s cubic-bezier(.4,0,.2,1), 
        box-shadow 0.2s cubic-bezier(.4,0,.2,1);
}

.actions button::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.18);
    border-radius: 100%;
    transform: translate(-50%, -50%);
    transition: width 0.4s cubic-bezier(.4,0,.2,1), height 0.4s cubic-bezier(.4,0,.2,1), opacity 0.4s;
    opacity: 0;
    pointer-events: none;
    z-index: 1;
}

.actions button:active::after {
    width: 180%;
    height: 400%;
    opacity: 1;
    transition: 0s;
}

.actions button:hover, .actions button:focus {
    /* 只保留浮动和阴影变化，不变色 */
    background: var(--button-bg);
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 4px 16px rgba(31,38,135,0.18);
}

#theme-toggle-btn {
    transition: filter 0.3s cubic-bezier(.4,0,.2,1), background 0.3s cubic-bezier(.4,0,.2,1);
}
#theme-toggle-btn:active {
    filter: brightness(0.95) saturate(1.2);
}

@media (max-width: 600px) {
    .container {
        padding: 28px 8vw 18px 8vw;
        min-width: unset;
    }
    h1 {
        font-size: 2em;
    }
    p {
        font-size: 1em;
    }
    .actions {
        flex-direction: column;
        gap: 0.8em;
    }
    .actions button {
        width: 100%;
    }
}

body.theme-circular-transition::before {
    content: "";
    position: fixed;
    left: var(--circle-x, 50vw);
    top: var(--circle-y, 50vh);
    width: 0;
    height: 0;
    border-radius: 50%;
    background: var(--next-bg-gradient, var(--bg-gradient));
    z-index: 0;
    pointer-events: none;
    transform: translate(-50%, -50%);
    animation: theme-circle-expand-bg 1.2s cubic-bezier(.4,0,.2,1) forwards;
    opacity: 1;
    transition: background 0s;
}

@keyframes theme-circle-expand-bg {
    from {
        width: 0;
        height: 0;
        opacity: 1;
    }
    to {
        width: 300vw;
        height: 300vw;
        opacity: 1;
    }
}

canvas {
    pointer-events: none;
    position: fixed !important;
    left: 0;
    top: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 5; /* 粒子层级：高于背景，低于卡片 */
}