:root {
    --bg-color: #1e1e1e;
    --taskbar-color: #101010;
    --accent-color: #0078d7;
    --text-color: #ffffff;
    --window-header: #2d2d2d;
    --hover-bg: rgba(255,255,255,0.1);
}

* { box-sizing: border-box; user-select: none; }
body { margin: 0; padding: 0; height: 100vh; width: 100vw; overflow: hidden; font-family: 'Segoe UI', sans-serif; background-color: #333; color: var(--text-color); display: flex; flex-direction: column; }

/* Desktop */
#desktop {
    flex: 1;
    position: relative;
    /* 修改：改为纯深灰色背景 */
    background-color: #2d2d30;
}

#desktop-icons {
    position: absolute; top: 0; left: 0; bottom: 0; right: 0;
    padding: 10px;
    display: grid;
    grid-template-rows: repeat(auto-fill, 86px);
    grid-auto-flow: column;
    justify-content: start;
    grid-gap: 8px;
    width: fit-content;
}

.desktop-icon {
    width: 74px; height: 86px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    cursor: pointer; border: 1px solid transparent;
    text-align: center; font-size: 12px; text-shadow: 1px 1px 2px black; color: white;
    border-radius: 2px;
}
.desktop-icon:hover { background: var(--hover-bg); border-color: rgba(255,255,255,0.2); }
.desktop-icon .icon-img { font-size: 32px; margin-bottom: 5px; }

/* Windows */
.window {
    position: absolute;
    background: var(--bg-color);
    border: 1px solid #444;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    display: flex; flex-direction: column;
    resize: both; overflow: hidden;
    min-width: 200px; min-height: 150px;
    transition: opacity 0.2s, transform 0.2s;
}
.window.hidden { opacity: 0; pointer-events: none; transform: scale(0.95); }
.window.maximized { top: 0 !important; left: 0 !important; width: 100% !important; height: 100% !important; resize: none; border: none; }

.window-header {
    height: 32px; background: var(--window-header);
    display: flex; justify-content: space-between; align-items: center;
    padding-left: 10px; cursor: default;
}
.window-title { font-size: 12px; }

.window-controls { display: flex; height: 100%; }
.control-btn {
    width: 46px; height: 100%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 14px; font-family: sans-serif;
}
.control-btn:hover { background: #444; }
.control-btn.close-btn:hover { background: #e81123; color: white; }

.window-content { flex: 1; position: relative; background: #fff; }
.window-content iframe { width: 100%; height: 100%; border: none; }
.iframe-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: none; z-index: 1; }
.window.dragging .iframe-overlay { display: block; }

/* Start Menu */
#start-menu {
    position: absolute; bottom: 40px; left: 0;
    width: 320px; height: 450px;
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(15px);
    display: flex; flex-direction: column;
    z-index: 9999;
    border: 1px solid #444;
    border-bottom: none;
    transition: transform 0.15s ease-in-out, opacity 0.15s ease-in-out;
    transform-origin: bottom left;
}
#start-menu.hidden { transform: translateY(20px) scale(0.95); opacity: 0; pointer-events: none; }

.start-content { flex: 1; padding: 0; display: flex; flex-direction: column; width: 100%; }

.search-box { padding: 16px; background: inherit; }
.search-box input {
    width: 100%; padding: 8px 12px;
    background: #000; border: 1px solid #444; border-bottom: 2px solid var(--accent-color);
    color: white; outline: none;
}

.app-list { overflow-y: auto; flex: 1; padding: 0 0 10px 0; }
.app-list::-webkit-scrollbar { width: 4px; }
.app-list::-webkit-scrollbar-thumb { background: #555; }

.start-item { display: flex; align-items: center; padding: 10px 16px; cursor: pointer; }
.start-item:hover { background: var(--hover-bg); }
.start-item-icon { margin-right: 12px; font-size: 20px; width: 30px; text-align: center;}

/* Taskbar */
#taskbar {
    height: 40px; background: var(--taskbar-color);
    display: flex; align-items: center; z-index: 10000;
}
.start-btn { 
    width: 48px; height: 100%; 
    display: flex; align-items: center; justify-content: center; 
    cursor: pointer; transition: background 0.1s;
    color: #ffffff; /* 确保 SVG 使用此颜色填充 */
}
.start-btn:hover, .start-btn.active { background: var(--hover-bg); }

/* 调整 SVG 尺寸 */
.start-btn svg { width: 20px; height: 20px; }

.task-container { flex: 1; display: flex; padding-left: 10px; overflow-x: auto; height: 100%; }
.task-item {
    display: flex; align-items: center;
    background: transparent;
    padding: 0 10px; margin-right: 2px;
    width: 160px; height: 100%;
    cursor: pointer; border-bottom: 2px solid transparent;
}
.task-item:hover { background: rgba(255,255,255,0.05); }
.task-item.active { background: rgba(255,255,255,0.1); border-bottom-color: var(--accent-color); }
.task-item-text { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-left: 8px; }

.sys-tray { width: 100px; display: flex; align-items: center; justify-content: flex-end; padding-right: 0; height: 100%;}
#clock { font-size: 12px; margin-right: 10px; text-align: center; cursor: default; }
.show-desktop { width: 5px; height: 100%; border-left: 1px solid #555; cursor: pointer; }
.show-desktop:hover { background: rgba(255,255,255,0.2); }