/* ==================== 全局样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ff6b6b;
    --secondary-color: #4ecdc4;
    --accent-color: #ffe66d;
    --dark-bg: #0f0f23;
    --card-bg: rgba(255, 255, 255, 0.05);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --glow-color: #00ffff;
    --shadow-glow: 0 0 20px rgba(0, 255, 255, 0.5);
}

html {
    font-size: 16px;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', Arial, sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ==================== 背景效果 ==================== */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.stars {
    position: absolute;
    width: 100%;
    height: 100%;
    background: transparent;
    animation: twinkle 3s infinite;
}

.stars::before,
.stars::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    box-shadow: 
        100px 200px white, 300px 100px white, 500px 300px white,
        700px 150px white, 200px 400px white, 600px 250px white,
        150px 500px white, 450px 450px white, 800px 400px white,
        250px 100px #4ecdc4, 550px 200px #ff6b6b, 350px 350px #ffe66d,
        650px 100px #4ecdc4, 150px 250px #ff6b6b, 750px 350px #ffe66d,
        400px 150px white, 900px 300px white, 50px 350px white;
    animation: moveStars 80s linear infinite;
}

.stars::after {
    width: 1px;
    height: 1px;
    box-shadow: 
        120px 220px white, 320px 120px white, 520px 320px white,
        720px 170px white, 220px 420px white, 620px 270px white,
        170px 520px white, 470px 470px white, 820px 420px white;
}

@keyframes twinkle {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes moveStars {
    from { transform: translateY(0); }
    to { transform: translateY(-1000px); }
}

.nebula {
    position: absolute;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 20% 30%, rgba(255, 107, 107, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 60%, rgba(78, 205, 196, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 40% 80%, rgba(255, 230, 109, 0.15) 0%, transparent 50%);
    animation: nebulaMove 20s ease-in-out infinite alternate;
}

@keyframes nebulaMove {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(20px, 20px) rotate(5deg); }
}

#particleCanvas {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0.3;
}

/* ==================== 容器布局 ==================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

/* ==================== 头部样式 ==================== */
.header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 1s ease-out;
}

.main-title {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    position: relative;
}

.title-glow {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #ffe66d, #ff6b6b);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 3s ease infinite;
    text-shadow: 0 0 30px rgba(255, 107, 107, 0.5);
    filter: drop-shadow(0 0 20px rgba(78, 205, 196, 0.6));
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    letter-spacing: 0.3em;
    animation: fadeIn 1.5s ease-out;
}

.greeting {
    font-size: 1.5rem;
    color: var(--accent-color);
    margin-top: 1rem;
    animation: fadeIn 2s ease-out;
    font-weight: 500;
}

/* ==================== 主内容区 ==================== */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

/* ==================== 时钟区域 ==================== */
.clock-section {
    grid-column: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.clock-container {
    position: relative;
    width: 100%;
    max-width: 500px;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: fadeInLeft 1s ease-out;
}

.clock-decoration {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.outer-ring,
.middle-ring,
.inner-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid;
}

.outer-ring {
    width: 100%;
    height: 100%;
    border-color: rgba(255, 107, 107, 0.3);
    animation: rotate 30s linear infinite;
}

.middle-ring {
    width: 85%;
    height: 85%;
    top: 7.5%;
    left: 7.5%;
    border-color: rgba(78, 205, 196, 0.3);
    animation: rotate 20s linear infinite reverse;
}

.inner-ring {
    width: 70%;
    height: 70%;
    top: 15%;
    left: 15%;
    border-color: rgba(255, 230, 109, 0.3);
    animation: rotate 15s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.clock {
    position: relative;
    width: 350px;
    height: 350px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(15, 15, 35, 0.9), rgba(15, 15, 35, 0.7));
    backdrop-filter: blur(10px);
    border: 3px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 0 30px rgba(0, 255, 255, 0.3),
        inset 0 0 30px rgba(0, 255, 255, 0.1),
        0 0 60px rgba(255, 107, 107, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.clock-marks {
    position: absolute;
    width: 100%;
    height: 100%;
}

.clock-marks::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: 
        repeating-conic-gradient(
            from 0deg,
            transparent 0deg,
            transparent 29deg,
            rgba(255, 255, 255, 0.5) 29deg,
            rgba(255, 255, 255, 0.5) 30deg
        );
    border-radius: 50%;
    mask: radial-gradient(circle, transparent 45%, black 45%, black 48%, transparent 48%);
}

.hand {
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform-origin: bottom center;
    border-radius: 10px;
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.hour-hand {
    width: 8px;
    height: 100px;
    background: linear-gradient(to top, #ff6b6b, #ff8787);
    margin-left: -4px;
    box-shadow: 0 0 15px rgba(255, 107, 107, 0.8);
}

.minute-hand {
    width: 6px;
    height: 130px;
    background: linear-gradient(to top, #4ecdc4, #6ee7de);
    margin-left: -3px;
    box-shadow: 0 0 15px rgba(78, 205, 196, 0.8);
}

.second-hand {
    width: 3px;
    height: 150px;
    background: linear-gradient(to top, #ffe66d, #fff094);
    margin-left: -1.5px;
    box-shadow: 0 0 15px rgba(255, 230, 109, 0.8);
}

.clock-center {
    position: absolute;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, #ffffff, #cccccc);
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
    z-index: 10;
}

.digital-clock {
    margin-top: 2rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.time-display {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.1em;
}

.date-display {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}

.week-display {
    font-size: 1rem;
    color: var(--accent-color);
}

/* ==================== 时间进度条 ==================== */
.time-progress {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 15px;
    backdrop-filter: blur(5px);
}

.progress-item {
    margin-bottom: 1rem;
}

.progress-item:last-child {
    margin-bottom: 0;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.progress-percent {
    color: var(--glow-color);
    font-weight: 600;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6b6b, #4ecdc4, #ffe66d);
    border-radius: 10px;
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ==================== 信息卡片区域 ==================== */
.info-section {
    grid-column: 2;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    animation: fadeInRight 1s ease-out;
}

.card-animate {
    animation: cardFloat 3s ease-in-out infinite;
}

.card-animate:nth-child(1) { animation-delay: 0s; }
.card-animate:nth-child(2) { animation-delay: 0.5s; }
.card-animate:nth-child(3) { animation-delay: 1s; }
.card-animate:nth-child(4) { animation-delay: 1.5s; }

@keyframes cardFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.lunar-card,
.festival-card,
.weather-card,
.poem-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.lunar-card::before,
.festival-card::before,
.weather-card::before,
.poem-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #ffe66d, #ff6b6b);
    background-size: 400% 400%;
    border-radius: 20px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: gradientBorder 3s ease infinite;
}

@keyframes gradientBorder {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.lunar-card:hover::before,
.festival-card:hover::before,
.weather-card:hover::before,
.poem-card:hover::before {
    opacity: 0.5;
}

.lunar-card:hover,
.festival-card:hover,
.weather-card:hover,
.poem-card:hover {
    transform: translateY(-5px);
    box-shadow: 
        0 12px 48px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(0, 255, 255, 0.3);
}

.card-header {
    margin-bottom: 1rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
}

.card-header h2 {
    font-size: 1.5rem;
    color: var(--glow-color);
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.card-content {
    line-height: 1.8;
}

/* 农历卡片 */
.lunar-date {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.solar-term {
    font-size: 1.3rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.term-icon {
    margin-right: 0.5rem;
}

.next-term {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.zodiac-year {
    font-size: 1.1rem;
    color: var(--accent-color);
}

/* 节日卡片 */
.current-festival {
    margin-bottom: 1rem;
    padding: 1rem;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
}

.festival-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.festival-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.upcoming-festivals h3 {
    font-size: 1rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

#festivalList {
    list-style: none;
}

#festivalList li {
    padding: 0.5rem;
    margin-bottom: 0.3rem;
    background: rgba(78, 205, 196, 0.1);
    border-radius: 5px;
    font-size: 0.9rem;
    border-left: 3px solid var(--secondary-color);
}

/* 天气卡片 */
.season-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.season-tips {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* 诗词卡片 */
.poem-content {
    text-align: center;
    padding: 1rem;
}

.poem-title {
    font-size: 1.1rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
    font-weight: 600;
}

.poem-text {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 2;
    font-family: 'KaiTi', 'STKaiti', serif;
}

.poem-author {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* ==================== 底部样式 ==================== */
.footer {
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    animation: fadeInUp 1s ease-out;
}

.footer-content {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.8;
}

.copyright {
    margin-bottom: 0.5rem;
}

.icp-info a,
.police-info {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.icp-info a:hover {
    color: var(--glow-color);
    text-decoration: underline;
}

/* ==================== 音效开关 ==================== */
.sound-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 2px solid var(--card-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    z-index: 100;
}

.sound-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(0, 255, 255, 0.4);
}

.sound-icon {
    font-size: 1.5rem;
}

/* ==================== 主题切换按钮 ==================== */
.theme-toggle {
    position: fixed;
    bottom: 8rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 2px solid var(--card-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    z-index: 100;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(255, 230, 109, 0.4);
}

.theme-icon {
    font-size: 1.5rem;
}

/* ==================== 全屏按钮 ==================== */
.fullscreen-toggle {
    position: fixed;
    bottom: 14rem;
    right: 2rem;
    width: 60px;
    height: 60px;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 2px solid var(--card-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    z-index: 100;
}

.fullscreen-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(255, 107, 107, 0.4);
}

.fullscreen-icon {
    font-size: 1.5rem;
}

/* ==================== 设置面板 ==================== */
.settings-panel {
    position: fixed;
    bottom: 20rem;
    right: 2rem;
    z-index: 100;
}

.settings-toggle {
    width: 60px;
    height: 60px;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 2px solid var(--card-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.settings-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(78, 205, 196, 0.4);
}

.settings-icon {
    font-size: 1.5rem;
}

.settings-content {
    position: absolute;
    bottom: 70px;
    right: 0;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.settings-content.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.settings-content h3 {
    color: var(--glow-color);
    margin-bottom: 1rem;
    font-size: 1.2rem;
    text-align: center;
}

.setting-item {
    margin-bottom: 1rem;
}

.setting-item label {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.setting-item input[type="checkbox"] {
    margin-right: 0.5rem;
    cursor: pointer;
    width: 18px;
    height: 18px;
}

/* ==================== 日间主题 ==================== */
body.light-theme {
    --dark-bg: #f0f4f8;
    --card-bg: rgba(255, 255, 255, 0.8);
    --card-border: rgba(0, 0, 0, 0.1);
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --glow-color: #0066cc;
}

body.light-theme .background {
    background: linear-gradient(to bottom, #87ceeb, #f0f4f8);
}

body.light-theme .stars::before,
body.light-theme .stars::after {
    opacity: 0.3;
}

body.light-theme .nebula {
    opacity: 0.5;
}

/* ==================== 页面内通知 ==================== */
.in-page-notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 2px solid var(--glow-color);
    border-radius: 15px;
    padding: 1rem 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 255, 255, 0.3);
    z-index: 1000;
    animation: slideInRight 0.5s ease-out;
    min-width: 250px;
}

.notification-content {
    color: var(--text-primary);
}

.notification-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--glow-color);
    margin-bottom: 0.5rem;
}

.notification-message {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.in-page-notification.fade-out {
    animation: slideOutRight 0.5s ease-out forwards;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* ==================== 快捷键提示 ==================== */
.keyboard-hint {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    font-size: 0.85rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 999;
}

.keyboard-hint.show {
    opacity: 1;
}

/* ==================== 动画定义 ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .clock-section,
    .info-section {
        grid-column: 1;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    .container {
        padding: 1rem;
    }
    
    .main-title {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .clock {
        width: 280px;
        height: 280px;
    }
    
    .hour-hand {
        height: 80px;
    }
    
    .minute-hand {
        height: 100px;
    }
    
    .second-hand {
        height: 120px;
    }
    
    .time-display {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 2rem;
    }
    
    .clock {
        width: 220px;
        height: 220px;
    }
    
    .time-display {
        font-size: 1.5rem;
    }
}
