/* 載入畫面 */
.nmh-boot-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.8s ease-out;
}

.nmh-boot-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.nmh-boot-content {
    text-align: center;
    max-width: 600px;
    padding: 40px;
}

.nmh-boot-logo {
    width: 200px;
    height: auto;
    margin-bottom: 30px;
    animation: bootLogoFade 1s ease-in-out;
}

@keyframes bootLogoFade {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.nmh-boot-text {
    color: #fff;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 40px;
    letter-spacing: 2px;
}

.nmh-boot-loader {
    width: 100%;
}

.nmh-boot-bar {
    width: 100%;
    height: 10px;
    background: #333;
    border: 2px solid #666;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

.nmh-boot-progress {
    height: 100%;
    background: linear-gradient(to right, #ffffff, #ffffff);
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.nmh-boot-status {
    color: #ffffff;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    text-align: left;
}

/* 桌面容器初始隱藏 */
.nmh-desktop-container {
    transition: opacity 0.8s ease-in;
}

.nmh-desktop-container.show {
    opacity: 1 !important;
}

@media (max-width: 768px) {
    .nmh-boot-logo {
        width: 150px;
    }
    
    .nmh-boot-text {
        font-size: 18px;
    }
    
    .nmh-boot-bar {
        height: 20px;
    }
    
    .nmh-boot-status {
        font-size: 12px;
    }
}

/* 桌面容器 */
.nmh-desktop-container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background: #008080; /* Windows 95 藍綠色 */
}

/* 頂部選單列 */
.nmh-menubar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 32px;
    background: linear-gradient(to bottom, #ffffff, #e0e0e0);
    border-bottom: 1px solid #808080;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 12px;
    z-index: 1001;
    color: #000;
}

.nmh-menubar-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nmh-site-title {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 400px;
}

.nmh-menubar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nmh-clock {
    font-weight: 500;
    white-space: nowrap;
}

/* 桌面圖示區域 */
.nmh-desktop-icons {
    position: absolute;
    top: 32px;
    left: 0;
    right: 0;
    bottom: 48px;
    padding: 20px;
    overflow: auto;
}

/* 單一圖示 */
.desktop-icon {
    position: absolute;
    width: 120px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 2px solid transparent;
    user-select: none;
}

.desktop-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

.desktop-icon.selected {
    background: rgba(0, 0, 128, 0.3);
    border: 2px dotted #fff;
}

.desktop-icon img {
    width: 64px;
    height: 64px;
    image-rendering: pixelated;
    pointer-events: none;
}

.desktop-icon .icon-label {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.9);
    word-break: break-word;
    line-height: 1.3;
    max-width: 100%;
}

/* 鍵盤 focus 視覺提示 */
.desktop-icon.keyboard-focused {
    outline: 3px dotted #fff;
    outline-offset: 3px;
    background: rgba(0, 0, 128, 0.4);
}

.desktop-icon:focus {
    outline: none;
}

/* 視窗容器 */
.nmh-windows-container {
    position: absolute;
    top: 32px;
    left: 0;
    right: 0;
    bottom: 48px;
    pointer-events: none;
    z-index: 50;
}

.nmh-windows-container > * {
    pointer-events: auto;
}

/* 工作列 */
.nmh-taskbar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 48px;
    background: #c0c0c0;
    border-top: 2px solid #fff;
    box-shadow: 0 -2px 4px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    padding: 0 8px;
    z-index: 1000;
}

.nmh-taskbar-items {
    display: flex;
    gap: 6px;
    flex: 1;
    overflow-x: auto;
}

.nmh-taskbar-item {
    background: #c0c0c0;
    border: 2px outset #fff;
    padding: 6px 16px;
    font-size: 13px;
    cursor: pointer;
    max-width: 220px;
    min-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}

.nmh-taskbar-item.active {
    border-style: inset;
    background: #e0e0e0;
}

.nmh-taskbar-item:not(.active):hover {
    background: #d0d0d0;
}

.nmh-taskbar-item img {
    width: 20px;
    height: 20px;
    image-rendering: pixelated;
    flex-shrink: 0;
}

.nmh-taskbar-item span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 載入動畫 */
.desktop-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 14px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* 平板版 */
@media (min-width: 769px) and (max-width: 1024px) {
    .desktop-icon {
        width: 100px;
    }
    
    .desktop-icon img {
        width: 56px;
        height: 56px;
    }
    
    .desktop-icon .icon-label {
        font-size: 12px;
    }
}

/* 手機版 */
@media (max-width: 768px) {
    /* 選單列 */
    .nmh-menubar {
        height: 44px;
        padding: 0 10px;
        font-size: 12px;
    }
    
    .nmh-site-title {
        font-size: 12px;
        max-width: 200px;
    }
    
    .nmh-clock {
        font-size: 11px;
    }
    
    /* 桌面區域 */
    .nmh-desktop-icons {
        top: 44px;
        bottom: 60px;
        padding: 10px;
    }
    
    .nmh-windows-container {
        top: 44px;
        bottom: 60px;
    }
    
    /* Icon 排列 - 類似手機 app */
    .desktop-icon {
        width: 20%;
        padding: 8px 4px;
        gap: 6px;
    }
    
    .desktop-icon img {
        width: 56px;
        height: 56px;
        border-radius: 12px;
        background: rgba(255,255,255,0.1);
        padding: 4px;
    }
    
    .desktop-icon .icon-label {
        font-size: 11px;
        font-weight: 500;
        line-height: 1.2;
    }
    
    /* 工作列 */
    .nmh-taskbar {
        height: 60px;
        overflow-x: auto;
        overflow-y: hidden;
    }
    
    .nmh-taskbar-items {
        flex-wrap: nowrap;
    }
    
    .nmh-taskbar-item {
        min-width: 100px;
        font-size: 11px;
        padding: 4px 10px;
    }
    
    .nmh-taskbar-item img {
        width: 18px;
        height: 18px;
    }
    
    /* 視窗 */
    .nmh-window {
        width: 95vw !important;
        height: 80vh !important;
        left: 2.5vw !important;
        top: 10vh !important;
    }
}