/**
 * 桌面时间壁纸样式
 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
}

.wallpaper-container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: background 1s ease-in-out;
    overflow: hidden;
}

/* 时间显示 */
.time-display {
    text-align: center;
    z-index: 10;
    user-select: none;
}

.time-main {
    font-size: 12vw;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
    letter-spacing: -0.02em;
    margin-bottom: 20px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.date-display {
    font-size: 2.5vw;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.05em;
}

/* 颜色选择器包装器 */
.color-picker-wrapper {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 15px;
}

/* 颜色选择器 */
.color-picker {
    display: flex;
    gap: 15px;
    padding: 15px 25px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border-radius: 50px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), 
                0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    transition: opacity 0.3s ease, 
                transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55),
                width 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55),
                height 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55),
                padding 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55),
                gap 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: hidden;
    position: relative;
    will-change: opacity, transform;
}

.color-picker::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.2), 
        transparent);
    transition: left 0.5s ease;
    pointer-events: none;
}

.color-picker:hover::before {
    left: 100%;
}

/* 收起状态 */
.color-picker.collapsed {
    width: 0 !important;
    height: 0 !important;
    padding: 0 !important;
    gap: 0 !important;
    opacity: 0 !important;
    transform: scale(0) !important;
    pointer-events: none;
    transition: opacity 0.2s ease,
                transform 0.2s ease,
                width 0.2s ease,
                height 0.2s ease,
                padding 0.2s ease,
                gap 0.2s ease;
}

.color-picker.collapsed::before {
    display: none;
}

.color-picker.collapsed .color-btn {
    opacity: 0;
    transform: scale(0);
    pointer-events: none;
}

/* 颜色按钮 */
.color-btn {
    width: 45px;
    height: 45px;
    border: 3px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    transition: opacity 0.3s ease,
                transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55),
                box-shadow 0.3s ease,
                border-color 0.3s ease;
    background: none;
    padding: 0;
    outline: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    opacity: 1;
    transform: scale(1);
}

.color-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.color-btn:hover::before {
    width: 100%;
    height: 100%;
}

.color-btn:hover {
    transform: scale(1.2) rotate(5deg);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4),
                0 0 30px rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.6);
}

.color-btn:active {
    transform: scale(1.1) rotate(-5deg);
}

.color-btn.active {
    border-color: rgba(255, 255, 255, 0.95);
    transform: scale(1.25);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.6), 
                0 6px 20px rgba(0, 0, 0, 0.4),
                0 0 0 4px rgba(255, 255, 255, 0.2);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 30px rgba(255, 255, 255, 0.6), 
                    0 6px 20px rgba(0, 0, 0, 0.4),
                    0 0 0 4px rgba(255, 255, 255, 0.2);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 255, 255, 0.8), 
                    0 8px 25px rgba(0, 0, 0, 0.5),
                    0 0 0 6px rgba(255, 255, 255, 0.3);
    }
}

/* 右侧控制按钮组 */
.control-buttons {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 控制按钮通用样式 */
.control-btn {
    width: 55px;
    height: 55px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2),
                0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    outline: none;
    position: relative;
    overflow: hidden;
}

.control-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.control-btn:hover::before {
    width: 100%;
    height: 100%;
}

.control-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3),
                0 0 30px rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.3);
}

.control-btn:active {
    transform: scale(0.95);
}

/* 切换按钮图标 */
.control-btn .toggle-icon,
.control-btn .fullscreen-icon,
.control-btn .custom-icon {
    width: 24px;
    height: 24px;
    stroke: rgba(255, 255, 255, 0.9);
    transition: all 0.4s ease;
    position: relative;
    z-index: 1;
}

.control-btn:hover .toggle-icon,
.control-btn:hover .fullscreen-icon,
.control-btn:hover .custom-icon {
    stroke: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

/* 展开状态下的切换按钮 */
.color-picker-toggle.expanded {
    background: rgba(255, 255, 255, 0.25);
}

.color-picker-toggle.expanded .toggle-icon {
    transform: rotate(180deg);
}

/* 全屏按钮图标切换 */
.fullscreen-toggle .fullscreen-icon.exit {
    display: none;
}

.fullscreen-toggle.fullscreen-active .fullscreen-icon.enter {
    display: none;
}

.fullscreen-toggle.fullscreen-active .fullscreen-icon.exit {
    display: block;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .time-main {
        font-size: 20vw;
    }
    
    .date-display {
        font-size: 5vw;
    }
    
    .color-picker-wrapper {
        bottom: 20px;
    }
    
    .color-picker {
        padding: 12px 20px;
        gap: 10px;
    }
    
    .color-btn {
        width: 35px;
        height: 35px;
    }
    
    .control-buttons {
        bottom: 20px;
        right: 20px;
        gap: 12px;
    }
    
    .control-btn {
        width: 45px;
        height: 45px;
    }
    
    .control-btn .toggle-icon,
    .control-btn .fullscreen-icon {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .time-main {
        font-size: 25vw;
    }
    
    .date-display {
        font-size: 6vw;
    }
    
    .color-picker-wrapper {
        max-width: 90%;
    }
    
    .color-picker {
        flex-wrap: wrap;
        justify-content: center;
        padding: 10px 15px;
    }
    
    .color-btn {
        width: 30px;
        height: 30px;
    }
    
    .control-buttons {
        bottom: 15px;
        right: 15px;
        gap: 10px;
    }
    
    .control-btn {
        width: 40px;
        height: 40px;
    }
    
    .control-btn .toggle-icon,
    .control-btn .fullscreen-icon {
        width: 18px;
        height: 18px;
    }
}

/* 背景动画效果 */
.wallpaper-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: pulse 20s ease-in-out infinite;
    pointer-events: none;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1) translate(0, 0);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.2) translate(10%, 10%);
        opacity: 0.8;
    }
}

/* 自定义颜色模态框 */
.custom-color-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-color-modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.custom-color-modal.show .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 24px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 32px;
    color: #666;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #333;
    transform: rotate(90deg);
}

.modal-body {
    color: #333;
}

.color-input-group {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

.color-input-group label {
    min-width: 80px;
    font-weight: 500;
    color: #555;
}

.color-input-group input[type="color"] {
    width: 60px;
    height: 40px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.color-input-group input[type="color"]:hover {
    border-color: rgba(0, 0, 0, 0.3);
    transform: scale(1.05);
}

.color-value {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #666;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 6px;
}

.preview-area {
    margin: 25px 0;
}

.preview-label {
    margin-bottom: 10px;
    font-weight: 500;
    color: #555;
}

.preview-gradient {
    width: 100%;
    height: 80px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: background 0.3s ease;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin: 25px 0;
}

.btn-save,
.btn-apply {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-save {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-apply {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.btn-apply:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(17, 153, 142, 0.4);
}

.custom-themes-list {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 2px solid rgba(0, 0, 0, 0.1);
}

.list-header {
    font-weight: 500;
    color: #555;
    margin-bottom: 15px;
}

.themes-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 12px;
}

.custom-theme-item {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    overflow: hidden;
}

.custom-theme-item:hover {
    transform: scale(1.1);
    border-color: rgba(0, 0, 0, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.custom-theme-item.active {
    border-color: rgba(102, 126, 234, 0.8);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
}

.theme-delete-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    font-size: 16px;
    color: #e74c3c;
    line-height: 1;
    padding: 0;
}

.custom-theme-item:hover .theme-delete-btn {
    opacity: 1;
}

.theme-delete-btn:hover {
    background: #e74c3c;
    color: white;
    transform: scale(1.1);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .modal-content {
        padding: 20px;
        max-width: 95%;
    }
    
    .modal-header h3 {
        font-size: 20px;
    }
    
    .color-input-group {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .color-input-group label {
        min-width: auto;
        margin-bottom: 8px;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .themes-container {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    }
}
