/**
 * NTP 时钟样式
 */

/* ===== 悬浮时钟容器 ===== */
.ntp-clock-container {
    position: fixed;
    z-index: 999999;
    user-select: none;
    pointer-events: none;
}

/* 位置：右下角 */
.ntp-clock-container[data-position="bottom-right"] {
    bottom: 30px;
    right: 30px;
    top: auto;
    left: auto;
}

/* 位置：左下角 */
.ntp-clock-container[data-position="bottom-left"] {
    bottom: 30px;
    left: 30px;
    top: auto;
    right: auto;
}

/* 位置：右上角 */
.ntp-clock-container[data-position="top-right"] {
    top: 100px;
    right: 30px;
    bottom: auto;
    left: auto;
}

/* 位置：左上角 */
.ntp-clock-container[data-position="top-left"] {
    top: 30px;
    left: 30px;
    bottom: auto;
    right: auto;
}

/* ===== 时钟主体 ===== */
#ntp-clock {
    pointer-events: auto;
    background: rgba(10, 25, 47, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 22px;
    padding: 20px 26px 18px 26px;
    min-width: 170px;
    box-shadow: 
        0 24px 80px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    text-align: center;
    color: #e8f0fe;
    cursor: default;
    font-family: -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

/* ===== 鼠标悬停背景色（橙色） ===== */
#ntp-clock:hover {
    background: rgba(230, 126, 34, 0.85);
    box-shadow: 0 28px 100px rgba(0, 0, 0, 0.65);
    transform: scale(1.03) translateY(-2px);
}

/* ===== 时间显示 ===== */
.ntp-clock-time {
    font-size: 2.6rem;
    font-weight: 600;
    letter-spacing: 5px;
    line-height: 1.2;
    text-shadow: 0 0 30px rgba(64, 164, 255, 0.12);
    font-variant-numeric: tabular-nums;
    color: #ffffff;
    transition: color 0.3s;
}

.ntp-clock-time.error {
    color: #f87171;
}

.ntp-clock-time.degraded {
    color: #fbbf24;
}

/* ===== 日期显示 ===== */
.ntp-clock-date {
    font-size: 1.5rem;
    opacity: 0.7;
    margin-top: 4px;
    letter-spacing: 1.5px;
    color: #b0ccee;
    font-weight: 500;
}

/* ===== 状态指示器 ===== */
.ntp-clock-status {
    font-size: 1.0rem;
    opacity: 0.6;
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: #E67E22;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.ntp-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
    animation: ntpPulse 2s ease-in-out infinite;
    flex-shrink: 0;
}

.ntp-dot.error {
    background: #f87171;
    animation: none;
}

.ntp-dot.degraded {
    background: #fbbf24;
    animation: ntpPulse 1.5s ease-in-out infinite;
}

@keyframes ntpPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.25;
        transform: scale(0.65);
    }
}

/* ===== NTP 服务器信息（已隐藏） ===== */
.ntp-clock-server {
    font-size: 0.6rem;
    opacity: 0;
    margin-top: 6px;
    color: #7aa9e6;
    transition: opacity 0.4s ease;
    letter-spacing: 0.5px;
    font-weight: 300;
    cursor: default;
    pointer-events: none;
}

#ntp-clock:hover .ntp-clock-server {
    opacity: 0;
}

/* ===== 响应式 ===== */
@media (max-width: 640px) {
    .ntp-clock-container[data-position="bottom-right"],
    .ntp-clock-container[data-position="bottom-left"] {
        bottom: 16px;
        right: 16px;
        left: 16px;
    }
    
    #ntp-clock {
        padding: 14px 18px 14px 18px;
        min-width: 130px;
        border-radius: 16px;
    }
    
    .ntp-clock-time {
        font-size: 2.0rem;
        letter-spacing: 3px;
    }
    
    .ntp-clock-date {
        font-size: 0.75rem;
    }
    
    .ntp-clock-status {
        font-size: 0.6rem;
    }
}

@media (max-width: 380px) {
    .ntp-clock-container[data-position="bottom-right"],
    .ntp-clock-container[data-position="bottom-left"] {
        bottom: 10px;
        right: 10px;
        left: 10px;
    }
    
    #ntp-clock {
        padding: 10px 14px 10px 14px;
        min-width: 100px;
        border-radius: 12px;
    }
    
    .ntp-clock-time {
        font-size: 1.6rem;
        letter-spacing: 2px;
    }
}

/* ===== 亮色主题 ===== */
@media (prefers-color-scheme: light) {
    #ntp-clock {
        background: rgba(255, 255, 255, 0.92);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid rgba(0, 0, 0, 0.06);
        color: #1a2634;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
    }
    
    /* 亮色主题下悬停背景色（浅橙色） */
    #ntp-clock:hover {
        background: rgba(20, 40, 70, 0.8);
        box-shadow: 0 28px 100px rgba(0, 0, 0, 0.1);
        transform: scale(1.03) translateY(-2px);
    }
    
    .ntp-clock-time {
        color: #0b1a2e;
    }
    
    .ntp-clock-date {
        color: #3d5a7a;
    }
    
    .ntp-clock-status {
        color: #E67E22;
    }
    
    .ntp-clock-server {
        color: #3b82f6;
    }
    
    .ntp-dot {
        background: #22c55e;
    }
    
    .ntp-dot.error {
        background: #ef4444;
    }
    
    .ntp-dot.degraded {
        background: #eab308;
    }
}