* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
}

:root {
    --time-font-size: min(12vw, 12rem);
    --date-font-size: min(2vw, 1.5rem);
    --container-width: min(90vw, 1200px);
    --transition-duration: 0.5s;
    --bg-image: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #1a1a1a;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    overflow: hidden;
    position: relative;
    transition: background-color var(--transition-duration) ease,
                color var(--transition-duration) ease;
}

/* 背景图片容器 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--bg-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -2;
    transition: opacity 1s ease;
}

/* 背景遮罩 */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.7) 0%,
        rgba(0, 0, 0, 0.5) 50%,
        rgba(0, 0, 0, 0.7) 100%
    );
    z-index: -1;
    transition: opacity 1s ease;
}

/* 浅色主题下的背景遮罩 */
body.light-theme::after {
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.7) 0%,
        rgba(255, 255, 255, 0.5) 50%,
        rgba(255, 255, 255, 0.7) 100%
    );
}

.clock-container {
    text-align: center;
    width: var(--container-width);
    padding: 0 2rem;
    position: relative;
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
}

.clock {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.time {
    font-size: var(--time-font-size);
    font-weight: 600;
    letter-spacing: -2px;
    margin-bottom: 0.5rem;
    line-height: 1;
    font-family: 'SF Mono', 'Roboto Mono', 'Consolas', monospace;
    width: 100%;
    text-align: center;
    white-space: nowrap;
    transition: color var(--transition-duration) ease;
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards 0.2s;
}

.date {
    font-size: var(--date-font-size);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 1rem;
    white-space: nowrap;
    transition: color var(--transition-duration) ease;
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards 0.4s;
}

/* 天气显示样式 */
.weather {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 1rem;
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards 0.6s;
}

.weather-icon {
    width: 32px;
    height: 32px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: brightness(0) invert(1);
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

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

.temperature {
    font-size: min(2.5vw, 1.2rem);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1;
}

.weather-desc {
    font-size: min(2vw, 0.9rem);
    color: rgba(255, 255, 255, 0.7);
    margin-top: 4px;
}

/* 浅色主题下的天气样式 */
body.light-theme .weather-icon {
    filter: none;
    opacity: 0.7;
}

body.light-theme .temperature {
    color: rgba(0, 0, 0, 0.8);
}

body.light-theme .weather-desc {
    color: rgba(0, 0, 0, 0.6);
}

/* 主题切换按钮样式 */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 80px;
    width: min(8vw, 40px);
    height: min(8vw, 40px);
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards 0.6s;
}

.theme-icon {
    width: min(4vw, 20px);
    height: min(4vw, 20px);
    position: relative;
    transform: rotate(0deg);
    transition: transform 0.5s ease;
}

.theme-toggle:hover .theme-icon {
    transform: rotate(30deg);
}

.sun-moon {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: currentColor;
    position: relative;
    transition: all 0.5s ease;
}

/* 太阳光芒 */
.sun-moon::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, currentColor 0%, transparent 70%);
    opacity: 0.2;
    transition: all 0.5s ease;
}

/* 月亮阴影 */
.dots {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
    transition: all 0.5s ease;
    background: transparent;
    border-radius: 50%;
    box-shadow: inset 0 0 0 0 currentColor;
}

/* 深色模式样式 */
.theme-toggle {
    color: rgba(255, 255, 255, 0.9);
}

.theme-toggle .sun-moon {
    box-shadow: 0 0 0 2px currentColor;
    background: transparent;
}

.theme-toggle .dots {
    box-shadow: inset 0 0 0 0 currentColor;
}

/* 浅色模式样式 */
body.light-theme .theme-toggle {
    color: rgba(0, 0, 0, 0.7);
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .theme-toggle .sun-moon {
    box-shadow: none;
    background: currentColor;
}

body.light-theme .theme-toggle .sun-moon::before {
    opacity: 0.1;
}

body.light-theme .theme-toggle .dots {
    box-shadow: inset 0 0 0 0 currentColor;
}

/* 其他主题下的切换按钮样式 */
body.blue-theme .theme-toggle,
body.purple-theme .theme-toggle,
body.green-theme .theme-toggle,
body.red-theme .theme-toggle {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
}

/* 设置按钮样式 */
.settings-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: min(8vw, 40px);
    height: min(8vw, 40px);
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards 0.8s;
}

.settings-btn::before {
    content: '';
    width: min(4vw, 20px);
    height: min(4vw, 20px);
    background: currentColor;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.07.62-.07.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z'/%3E%3C/svg%3E");
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    color: rgba(255, 255, 255, 0.9);
}

.settings-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: rotate(30deg);
}

/* 浅色主题下的设置按钮样式 */
body.light-theme .settings-btn {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

body.light-theme .settings-btn::before {
    color: rgba(0, 0, 0, 0.7);
}

body.light-theme .settings-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* 设置弹窗样式 */
.settings-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0);
    z-index: 1000;
    transition: background-color 0.3s ease;
}

.settings-modal.show {
    background-color: rgba(0, 0, 0, 0.5);
}

.settings-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.7);
    background-color: #2d2d2d;
    padding: min(4vw, 2rem);
    border-radius: 8px;
    width: min(90vw, 400px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: all 0.3s ease;
    color: #fff;
}

/* 浅色主题下的样式 */
body.light-theme .settings-content {
    background-color: #fff;
    color: #333;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.settings-modal.show .settings-content {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: min(3vw, 1.5rem);
}

.settings-header h2 {
    font-size: min(4vw, 1.5rem);
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: min(4vw, 1.5rem);
    cursor: pointer;
    padding: min(1vw, 0.5rem);
    transition: transform 0.2s ease;
    color: #fff;
}

.close-btn:hover {
    transform: rotate(90deg);
}

.setting-item {
    margin-bottom: min(2vw, 1rem);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.settings-modal.show .setting-item {
    opacity: 1;
    transform: translateY(0);
}

.settings-modal.show .setting-item:nth-child(1) { transition-delay: 0.1s; }
.settings-modal.show .setting-item:nth-child(2) { transition-delay: 0.2s; }
.settings-modal.show .setting-item:nth-child(3) { transition-delay: 0.3s; }
.settings-modal.show .setting-item:nth-child(4) { transition-delay: 0.4s; }

.setting-item label {
    display: block;
    margin-bottom: min(1vw, 0.5rem);
    font-weight: 500;
    font-size: min(3.5vw, 1rem);
    color: rgba(255, 255, 255, 0.9);
}

.setting-item select {
    width: 100%;
    padding: min(1vw, 0.5rem);
    border: 1px solid #4d4d4d;
    border-radius: 4px;
    font-size: min(3.5vw, 1rem);
    transition: border-color 0.3s ease;
    background-color: #3d3d3d;
    color: #fff;
}

.setting-item select:focus {
    border-color: #666;
    outline: none;
}

/* 提示弹窗样式 */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: min(2vw, 12px) min(4vw, 24px);
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: min(3vw, 14px);
    animation: slideIn 0.3s ease-out, fadeOut 0.3s ease-out 2.7s;
    opacity: 0;
    transform: translateX(100%);
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

/* 主题样式 */
body.light-theme {
    background-color: #fff;
    color: #333;
    transition: background-color var(--transition-duration) ease,
                color var(--transition-duration) ease;
}

body.light-theme .settings-content {
    background-color: #fff;
    color: #333;
}

body.light-theme .setting-item select {
    background-color: #f5f5f5;
    color: #333;
    border-color: #ddd;
}

body.light-theme .setting-item label {
    color: #333;
}

body.light-theme .close-btn {
    color: #333;
}

body.light-theme .settings-header h2 {
    color: #333;
}

body.light-theme .date {
    color: rgba(0, 0, 0, 0.6);
    transition: color var(--transition-duration) ease;
}

body.light-theme .settings-btn,
body.light-theme .close-btn {
    color: #333;
}

body.light-theme .pixiv-source {
    color: rgba(0, 0, 0, 0.6);
}

body.light-theme .pixiv-source:hover {
    color: rgba(0, 0, 0, 0.8);
}

@media (max-width: 768px) {
    .time {
        font-size: 8rem;
        min-width: 500px;
    }
    .date {
        font-size: 1.2rem;
    }
    .settings-content {
        width: 90%;
        max-width: 300px;
    }
}

/* 入场动画关键帧 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pixiv图片来源说明样式 */
.pixiv-source {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards 1s;
    transition: all 0.3s ease;
    z-index: 1000;
}

.pixiv-source:hover {
    color: rgba(255, 255, 255, 1);
}

.pixiv-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    opacity: 0.8;
    transition: opacity 0.3s ease;
    color: currentColor;
}

.pixiv-source:hover .pixiv-icon {
    opacity: 1;
}

/* 加载动画样式 */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #1a1a1a;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin: 0 auto 20px;
}

.loading-text {
    color: #fff;
    font-size: 16px;
    font-weight: 500;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 浅色主题下的加载动画样式 */
body.light-theme .loading-screen {
    background-color: #fff;
}

body.light-theme .loading-spinner {
    border-color: rgba(0, 0, 0, 0.3);
    border-top-color: #333;
}

body.light-theme .loading-text {
    color: #333;
}

/* 系统信息显示样式 */
.system-info {
    position: fixed;
    bottom: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards 1s;
    z-index: 1000;
}

.info-item {
    background: rgba(0, 0, 0, 0.5);
    padding: 6px 12px;
    border-radius: 4px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.info-item:hover {
    background: rgba(0, 0, 0, 0.7);
    color: rgba(255, 255, 255, 1);
}

/* 浅色主题下的系统信息样式 */
body.light-theme .system-info {
    color: rgba(0, 0, 0, 0.8);
}

body.light-theme .info-item {
    background: rgba(255, 255, 255, 0.5);
}

body.light-theme .info-item:hover {
    background: rgba(255, 255, 255, 0.7);
    color: rgba(0, 0, 0, 1);
} 