/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    height: 100vh;
    overflow: hidden;
    position: relative;
    color: #333;
}

/* 粒子画布 */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -3;
}

/* 背景图片 */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('./background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -2;
}

/* ===== 天气动效层 ===== */
.weather-scene {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: -1;
    transition: opacity 1.2s ease, filter 1.2s ease;
}

.weather-scene::before,
.weather-scene::after {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1.4s ease;
}

/* 晴天 */
.scene-sunny {
    background: linear-gradient(180deg, rgba(252, 236, 178, 0.08) 0%, rgba(187, 217, 255, 0.15) 100%);
}
.scene-sunny::before {
    background: radial-gradient(circle at 80% 18%, rgba(255, 229, 157, 0.6), rgba(255, 229, 157, 0) 60%);
    opacity: 0.85;
    animation: sunPulse 14s ease-in-out infinite;
}
.scene-sunny::after {
    background: radial-gradient(circle at 65% 32%, rgba(255, 250, 238, 0.35), rgba(255, 250, 238, 0));
    opacity: 0.4;
}
.sun-orb {
    position: absolute;
    top: 8%;
    right: 12%;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 250, 210, 0.65) 0%, rgba(255, 250, 210, 0.08) 65%, rgba(255, 250, 210, 0) 100%);
    box-shadow: 0 0 45px rgba(255, 210, 120, 0.35);
    animation: sunFloat 18s ease-in-out infinite;
    opacity: 0.8;
}
.sun-glint {
    position: absolute;
    top: 28%;
    right: 22%;
    width: 120px;
    height: 2px;
    background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.65), rgba(255,255,255,0));
    transform: rotate(22deg);
    animation: sunGlint 7s linear infinite;
    opacity: 0.35;
}

/* 多云 / 阴 / 风 */
.scene-cloudy,
.scene-overcast,
.scene-wind {
    background: linear-gradient(180deg, rgba(210, 222, 235, 0.12) 0%, rgba(170, 188, 210, 0.18) 100%);
}
.scene-overcast {
    filter: saturate(0.85) brightness(0.95);
}
.cloud {
    position: absolute;
    top: var(--top, 25%);
    left: -35%;
    width: 360px;
    height: 160px;
    background: rgba(255, 255, 255, 0.55);
    border-radius: 120px;
    box-shadow: 0 25px 70px rgba(41, 128, 185, 0.12);
    animation: floatCloud var(--duration, 60s) linear infinite;
    animation-delay: var(--delay, 0s);
}
.scene-overcast .cloud {
    background: rgba(220, 230, 240, 0.48);
    box-shadow: 0 25px 70px rgba(40, 60, 90, 0.16);
}
.cloud::before,
.cloud::after {
    content: '';
    position: absolute;
    background: inherit;
    border-radius: inherit;
    opacity: 0.9;
}
.cloud::before {
    width: 70%;
    height: 70%;
    top: -35%;
    left: 8%;
}
.cloud::after {
    width: 58%;
    height: 58%;
    top: -25%;
    right: 7%;
}

/* 雨 */
.scene-rain {
    background: linear-gradient(180deg, rgba(120, 140, 165, 0.26) 0%, rgba(70, 90, 115, 0.32) 100%);
    filter: saturate(0.85);
}
.rain-cloud {
    position: absolute;
    top: 14%;
    left: 50%;
    width: 80%;
    max-width: 900px;
    height: 45%;
    transform: translateX(-50%);
    background: radial-gradient(circle at 50% 40%, rgba(160, 180, 205, 0.26), rgba(90, 110, 140, 0.1) 70%);
    filter: blur(6px);
    opacity: 0.65;
    animation: rainCloudDrift 26s ease-in-out infinite;
}
.raindrop {
    position: absolute;
    top: -120px;
    width: 2px;
    border-radius: 40%;
    background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(180, 210, 255, 0.8) 75%, rgba(180, 210, 255, 0.9) 100%);
    opacity: 0.55;
    animation: fallRain 1.4s linear infinite;
}
.rain-mist {
    position: absolute;
    left: -20%;
    width: 140%;
    bottom: -10vh;
    height: 40vh;
    background: linear-gradient(180deg, rgba(160, 180, 200, 0) 0%, rgba(120, 140, 160, 0.18) 45%, rgba(80, 110, 150, 0.3) 100%);
    filter: blur(8px);
    animation: rainMist 6s ease-in-out infinite;
    opacity: 0.4;
}

/* 雪 */
.scene-snow {
    background: linear-gradient(180deg, rgba(220, 233, 250, 0.2) 0%, rgba(170, 196, 230, 0.22) 100%);
}
.snow-haze {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 65%, rgba(255,255,255,0.16), rgba(200, 220, 240, 0.08), rgba(200, 220, 240, 0));
    filter: blur(8px);
    animation: snowHaze 20s ease-in-out infinite;
    opacity: 0.6;
}
.flake {
    position: absolute;
    top: -10vh;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.35);
    animation: fallSnow 12s linear infinite;
    opacity: 0;
}

/* 雾 */
.scene-fog {
    background: linear-gradient(180deg, rgba(220, 225, 230, 0.18) 0%, rgba(190, 198, 205, 0.2) 100%);
    filter: saturate(0.92);
}
.scene-fog::before {
    opacity: 0.8;
    background: linear-gradient(180deg, rgba(255,255,255,0.32) 0%, rgba(210, 220, 230, 0.22) 60%, rgba(180, 190, 200, 0.32) 100%);
    filter: blur(18px);
    animation: fogMove 60s ease-in-out infinite;
}
.scene-fog::after {
    opacity: 0.45;
    background: radial-gradient(circle at 40% 50%, rgba(255, 255, 255, 0.25), rgba(255,255,255,0));
    animation: fogDrift 45s linear infinite;
}
.fog-layer {
    position: absolute;
    left: -10%;
    width: 120%;
    height: 35vh;
    background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.18), rgba(210, 220, 230, 0.08), rgba(210, 220, 230, 0));
    filter: blur(15px);
    opacity: 0.45;
    animation: fogLayerMove 42s linear infinite;
}
.fog-layer-1 { top: 12%; animation-duration: 48s; }
.fog-layer-2 { top: 42%; animation-duration: 56s; animation-delay: -12s; opacity: 0.4; }
.fog-layer-3 { bottom: -4%; animation-duration: 52s; animation-delay: -6s; opacity: 0.35; }

/* 风 */
.scene-wind .cloud {
    opacity: 0.75;
}
.gust {
    position: absolute;
    left: -20%;
    width: 45%;
    max-width: 320px;
    height: 2px;
    background: linear-gradient(90deg, rgba(255,255,255,0), rgba(200, 220, 235, 0.65), rgba(255,255,255,0));
    border-radius: 999px;
    filter: blur(0.3px);
    opacity: 0;
    animation: gustMove 8s ease-in-out infinite;
}

/* 动效关键帧 */
@keyframes sunPulse {
    0%, 100% { opacity: 0.45; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.08); }
}
@keyframes sunFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(12px); }
}
@keyframes sunGlint {
    0% { transform: translateX(-30px) rotate(22deg); opacity: 0; }
    50% { opacity: 0.4; }
    100% { transform: translateX(60px) rotate(22deg); opacity: 0; }
}
@keyframes floatCloud {
    0% { transform: translateX(-10%) scale(var(--scale, 1)); opacity: 0; }
    10% { opacity: 0.85; }
    90% { opacity: 0.75; }
    100% { transform: translateX(130vw) scale(var(--scale, 1)); opacity: 0; }
}
@keyframes rainCloudDrift {
    0%, 100% { transform: translate3d(-50%, 0, 0); }
    50% { transform: translate3d(-52%, 8px, 0); }
}
@keyframes fallRain {
    0% { transform: translateY(-160px); opacity: 0; }
    15% { opacity: 0.6; }
    100% { transform: translateY(120vh); opacity: 0; }
}
@keyframes rainMist {
    0%, 100% { transform: translateY(0); opacity: 0.35; }
    50% { transform: translateY(-10px); opacity: 0.5; }
}
@keyframes snowHaze {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}
@keyframes fallSnow {
    0% { transform: translate3d(0, -12vh, 0) scale(1); opacity: 0; }
    15% { opacity: 0.8; }
    50% { transform: translate3d(calc(var(--drift, 20px) * 0.5), 48vh, 0) scale(0.95); }
    100% { transform: translate3d(var(--drift, 20px), 110vh, 0) scale(0.9); opacity: 0; }
}
@keyframes fogMove {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(10px); }
}
@keyframes fogDrift {
    0% { transform: translate3d(-4%, 0, 0); }
    50% { transform: translate3d(4%, 10px, 0); }
    100% { transform: translate3d(-4%, 0, 0); }
}
@keyframes fogLayerMove {
    0% { transform: translateX(-4%); }
    50% { transform: translateX(4%); }
    100% { transform: translateX(-4%); }
}
@keyframes gustMove {
    0% { transform: translateX(0); opacity: 0; }
    15% { opacity: 0.35; }
    100% { transform: translateX(130vw); opacity: 0; }
}

/* 毛玻璃遮罩层 */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 0;
}

/* 通用卡片样式 */
.card-style {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(91, 155, 213, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

/* 七日天气预报 - 左上角 */
.weather-container {
    position: fixed;
    top: 30px;
    left: 30px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(20px);
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(91, 155, 213, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.6);
    z-index: 100;
    min-width: 280px;
    max-width: 350px;
}

.weather-title {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    color: #5B9BD5;
    font-weight: 600;
    font-size: 16px;
}

.weather-title i {
    margin-right: 8px;
    font-size: 18px;
}

.weather-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.weather-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background: rgba(91, 155, 213, 0.08);
    border-radius: 10px;
    transition: all 0.3s;
}

.weather-item:hover {
    background: rgba(91, 155, 213, 0.15);
    transform: translateX(5px);
}

.weather-date {
    display: flex;
    flex-direction: column;
    min-width: 60px;
}

.weather-day {
    font-size: 14px;
    color: #666;
}

.weather-weekday {
    font-size: 12px;
    color: #999;
}

.weather-icon {
    font-size: 28px;
    margin: 0 10px;
}

.weather-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex: 1;
}

.weather-temp {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.weather-desc {
    font-size: 12px;
    color: #666;
}

.weather-loading {
    text-align: center;
    color: #999;
    padding: 20px;
}

/* 快捷链接 - 右上角 */
.quick-links {
    position: fixed;
    top: 30px;
    right: 30px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(91, 155, 213, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.6);
    z-index: 100;
}

.links-title {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    color: #5B9BD5;
    font-weight: 600;
    font-size: 16px;
}

.links-title i {
    margin-right: 8px;
    font-size: 18px;
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.link-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px 10px;
    background: rgba(91, 155, 213, 0.08);
    border-radius: 12px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
    min-width: 80px;
}

.link-item:hover {
    background: rgba(91, 155, 213, 0.2);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(91, 155, 213, 0.3);
}

.link-item img {
    width: 32px;
    height: 32px;
    margin-bottom: 8px;
    border-radius: 6px;
}

.link-icon-text {
    width: 32px;
    height: 32px;
    margin-bottom: 8px;
    background: #5B9BD5;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-weight: bold;
    font-size: 14px;
}

.link-item span {
    font-size: 12px;
    text-align: center;
}

/* 主卡片 - 居中 */
.main-card {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    padding: 50px 60px;
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(91, 155, 213, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.7);
    text-align: center;
    min-width: 600px;
    max-width: 800px;
    animation: fadeIn 1s ease-in;
    z-index: 10;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -45%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* 时钟容器 */
.clock-container {
    margin-bottom: 30px;
}

.time {
    font-size: 72px;
    font-weight: 200;
    color: #5B9BD5;
    letter-spacing: 3px;
    margin-bottom: 15px;
    font-family: 'Courier New', monospace;
}

.date-info {
    color: #666;
}

.date {
    font-size: 20px;
    margin-bottom: 8px;
}

.week-lunar {
    font-size: 14px;
    color: #999;
}

.separator {
    margin: 0 8px;
}

/* 分隔线 */
.divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #5B9BD5, transparent);
    margin: 30px 0;
}

/* 句子容器 */
.quote-container {
    margin: 25px 0;
    padding: 25px;
    background: rgba(91, 155, 213, 0.08);
    border-radius: 15px;
    border-left: 4px solid #5B9BD5;
    position: relative;
}

.quote-icon {
    position: absolute;
    top: 15px;
    left: 15px;
    color: #5B9BD5;
    opacity: 0.3;
    font-size: 20px;
}

.quote {
    font-family: "LXGW WenKai", serif;
    font-size: 18px;
    line-height: 1.8;
    color: #2E5C8A;
    font-weight: 500;
    padding-left: 30px;
}

/* 诗词容器 */
.poem-container {
    margin: 25px 0;
    padding: 25px;
    background: rgba(124, 185, 232, 0.08);
    border-radius: 15px;
    border-right: 4px solid #7CB9E8;
}

.poem-content {
    font-family: "LXGW WenKai", serif;
    color: #2E5C8A;
}

.poem-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #5B9BD5;
}

.poem-text {
    font-size: 16px;
    line-height: 2;
    margin-bottom: 10px;
}

.poem-author {
    font-size: 14px;
    color: #999;
    text-align: right;
    margin-top: 15px;
}

.poem-loading {
    text-align: center;
    color: #999;
}

.page-signature {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #5B9BD5;
    font-size: 14px;
    letter-spacing: 2px;
    font-weight: 300;
    z-index: 50;
    text-shadow: 0 2px 4px rgba(255, 255, 255, 0.1);
}

/* 音乐播放器 - 右下角 */
.music-player {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(20px);
    padding: 10px;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(91, 155, 213, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.6);
    z-index: 100;
}

.music-player iframe {
    display: block;
    border-radius: 10px;
}

/* 响应式设计 */
@media (max-width: 1400px) {
    .quick-links {
        top: auto;
        bottom: 150px;
        right: 30px;
    }
}

@media (max-width: 1024px) {
    .main-card {
        min-width: 90%;
        padding: 40px 30px;
    }
    
    .time {
        font-size: 56px;
    }
    
    .weather-container,
    .quick-links {
        top: 15px;
        left: 15px;
        right: auto;
        max-width: calc(50% - 20px);
    }
    
    .quick-links {
        left: auto;
        right: 15px;
    }
    
    .sun-orb {
        width: 180px;
        height: 180px;
        top: 10%;
        right: 10%;
    }
    
    .cloud {
        width: 300px;
        height: 130px;
    }
    
    .rain-cloud {
        width: 90%;
        height: 42%;
    }
}

@media (max-width: 768px) {
    .time {
        font-size: 48px;
    }
    
    .quote,
    .poem-text {
        font-size: 16px;
    }
    
    .weather-container,
    .quick-links {
        position: relative;
        top: 10px;
        left: 10px;
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    .music-player {
        bottom: 15px;
        right: 15px;
    }
    
    .music-player iframe {
        width: 280px;
    }
    
    .sun-orb {
        width: 160px;
        height: 160px;
    }
    
    .cloud {
        width: 260px;
        height: 120px;
    }
    
    .rain-cloud {
        width: 110%;
        height: 40%;
    }
}

/* 无动画偏好 */
@media (prefers-reduced-motion: reduce) {
    .weather-scene,
    .weather-scene * {
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
