/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

/* 启动遮罩层 */
.start-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.start-content {
    text-align: center;
    animation: pulse 2s infinite;
}

.start-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.start-text {
    font-size: 1.5rem;
    color: #ffffff;
    font-weight: 300;
    letter-spacing: 2px;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

/* 时钟容器 */
.clock-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100vw;
    position: relative;
    z-index: 10;
}

/* 天气容器 */
.weather-container {
    position: absolute;
    top: 20px;
    right: 30px;
    text-align: right;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 时间显示区域 */
.time-display {
    text-align: center;
    margin-bottom: 60px;
}

/* 时间样式 */
.time {
    font-size: 8rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
    font-variant-numeric: tabular-nums;
}

/* 日期样式 */
.date {
    font-size: 2.5rem;
    font-weight: 500;
    opacity: 0.9;
    letter-spacing: 0.05em;
}

/* 农历日期样式 */
.lunar-date {
    font-size: 1.8rem;
    font-weight: 400;
    opacity: 0.8;
    margin-top: 10px;
    letter-spacing: 0.05em;
    font-family: "KaiTi", "楷体", "STKaiti", "华文楷体", serif;
}

/* 节日倒计时样式 */
.countdown {
    font-size: 1.2rem;
    font-weight: 300;
    opacity: 0.7;
    margin-top: 8px;
    letter-spacing: 0.05em;
    color: #ffcccc;
}

/* 励志短句样式 */
.quote {
    font-size: 2.5rem;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 30px;
    font-weight: 300;
    letter-spacing: 1px;
    font-style: italic;
    text-align: center;
    max-width: 80%;
    line-height: 1.4;
    transition: opacity 0.5s ease;
}

/* 控制按钮区域 */
.controls {
    position: absolute;
    bottom: 40px;
    display: flex;
    gap: 20px;
}

/* 控制按钮样式 */
.control-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.control-btn:hover,
.control-btn:active {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

/* 深色主题 */
body.dark-theme {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

/* 浅色主题 */
body.light-theme {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: #ffffff;
}

/* 经典主题 */
body.classic-theme {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* iPad横屏适配 */
@media screen and (orientation: landscape) {
    .time {
        font-size: 10rem;
    }
    
    .date {
        font-size: 3rem;
    }

    .lunar-date {
        font-size: 2.2rem;
    }
}

/* iPad竖屏适配 */
@media screen and (orientation: portrait) {
    .time {
        font-size: 7rem;
    }
    
    .date {
        font-size: 2.2rem;
    }

    .lunar-date {
        font-size: 1.6rem;
    }
}

/* 小屏幕适配 */
@media screen and (max-width: 768px) {
    .time {
        font-size: 5rem;
    }
    
    .date {
        font-size: 1.8rem;
    }

    .lunar-date {
        font-size: 1.4rem;
    }
    
    .control-btn {
        padding: 10px 20px;
        font-size: 1rem;
    }
}

/* 专注模式样式 */
body.pomodoro-mode .date,
body.pomodoro-mode .lunar-date,
body.pomodoro-mode .countdown,
body.pomodoro-mode .quote,
body.pomodoro-mode .weather-container,
body.pomodoro-mode .floating-decorations {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

body.pomodoro-mode .time {
    transform: scale(1.2);
    transition: transform 0.5s ease;
    color: #ff6b6b; /* 专注时的醒目颜色 */
}

/* 按钮激活状态 */
.control-btn.active {
    background: rgba(255, 255, 255, 0.5);
    border-color: #ffffff;
    font-weight: bold;
}

/* 全屏模式样式 */
.fullscreen .controls {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.fullscreen:hover .controls,
.fullscreen:active .controls {
    opacity: 1;
}

/* 模拟全屏样式（用于不支持全屏API的设备） */
.simulated-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999 !important;
    background: inherit;
    overflow: hidden;
}

.simulated-fullscreen .clock-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* iPad Safari地址栏隐藏优化 */
.simulated-fullscreen {
    -webkit-overflow-scrolling: touch;
}

@media screen and (max-device-width: 1024px) {
    .simulated-fullscreen {
        /* 确保在移动设备上完全覆盖 */
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.time, .date {
    animation: fadeIn 1s ease-out;
}

/* 数字切换动画 */
.time-transition {
    transition: all 0.3s ease;
}

/* 漂浮装饰元素 */
.floating-decorations {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.floating-item {
    position: absolute;
    font-size: 2rem;
    opacity: 0.6;
    /* 回退动画，不使用CSS变量 */
    animation: float 20s ease-in-out infinite;
    animation-delay: 0s;
}



/* 不同元素的初始位置和动画 */
.cloud {
    top: 10%;
    left: -5%;
    font-size: 2.5rem;
    animation: float 20s ease-in-out infinite;
    animation-delay: 0s;
}

.star {
    top: 20%;
    right: -5%;
    font-size: 1.8rem;
    animation: float 25s ease-in-out infinite;
    animation-delay: 2s;
}

.moon {
    top: 15%;
    left: 80%;
    font-size: 2.2rem;
    animation: float 30s ease-in-out infinite;
    animation-delay: 4s;
}

.sun {
    top: 25%;
    left: 10%;
    font-size: 2.3rem;
    animation: float 22s ease-in-out infinite;
    animation-delay: 6s;
}

.heart {
    top: 60%;
    right: 10%;
    font-size: 1.5rem;
    animation: float 28s ease-in-out infinite;
    animation-delay: 8s;
}

.flower {
    top: 70%;
    left: 5%;
    font-size: 1.8rem;
    animation: float 26s ease-in-out infinite;
    animation-delay: 10s;
}

.butterfly {
    top: 40%;
    right: 20%;
    font-size: 1.6rem;
    animation: float 24s ease-in-out infinite;
    animation-delay: 12s;
}

.leaf {
    top: 80%;
    left: 70%;
    font-size: 1.4rem;
    animation: float 32s ease-in-out infinite;
    animation-delay: 14s;
}

/* 漂浮动画 */
@keyframes float {
    0% {
        transform: translateY(0px) translateX(0px) rotate(0deg);
        opacity: 0.6;
    }
    25% {
        transform: translateY(-20px) translateX(10px) rotate(5deg);
        opacity: 0.8;
    }
    50% {
        transform: translateY(-10px) translateX(-15px) rotate(-3deg);
        opacity: 0.7;
    }
    75% {
        transform: translateY(-25px) translateX(8px) rotate(7deg);
        opacity: 0.9;
    }
    100% {
        transform: translateY(0px) translateX(0px) rotate(0deg);
        opacity: 0.6;
    }
}

/* 全屏模式下隐藏漂浮元素 */
.fullscreen .floating-decorations {
    opacity: 0.3;
    transition: opacity 0.5s ease;
}

/* 响应式调整 */
@media screen and (max-width: 768px) {
    .floating-item {
        font-size: 1.5rem;
    }
    
    .cloud {
        font-size: 2rem;
    }
    
    .moon {
        font-size: 1.8rem;
    }
    
    .sun {
        font-size: 1.9rem;
    }
}

/* iPad横屏时的调整 */
@media screen and (orientation: landscape) {
    .floating-item {
        font-size: 2.2rem;
    }
}

/* 深色主题下的调整 */
body.dark-theme .floating-item {
    opacity: 0.4;
}

/* 浅色主题下的调整 */
body.light-theme .floating-item {
    opacity: 0.7;
}

/* 经典主题下的调整 */
body.classic-theme .floating-item {
    opacity: 0.5;
}