/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: url('../images/background/gif01.gif') center/cover no-repeat fixed;
    height: 100vh;
    overflow: hidden;
    user-select: none;
}

/* 桌面图标区域 */
#desktop-icons {
    padding: 20px;
    display: grid;
    grid-template-columns: 96px;
    grid-gap: 20px;
    height: 90vh;
    align-content: flex-start;
    justify-content: start;
    grid-auto-flow: row;
    grid-auto-rows: min-content;
    grid-auto-columns: 96px;
    grid-template-rows: repeat(auto-fill, 128px);
    overflow-y: auto;
    overflow-x: auto;
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    align-items: flex-start;
}

.desktop-icon {
    width: 96px;
    height: 125px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 8px;
    border-radius: 8px;
    margin-bottom: 0;
}

.desktop-icon:hover {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.desktop-icon img {
    width: 58px;
    height: 58px;
    margin-bottom: 5px;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.desktop-icon:hover img {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.icon-title {
    color: white;
    text-align: center;
    font-size: 14px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 5px;
}

/* 恒生大学链接样式 */
.icon-title a {
    color: white;
    text-decoration: none;
    transition: all 0.2s ease;
}

.icon-title a:hover {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* 底部Dock */
#dock {
    position: fixed;
    bottom: 0;
    left: 0; /* 固定在右侧 */
    display: flex;
    justify-content: flex-start; /* 从左开始排列图标 */
    align-items: center;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 16px 16px 0 0;
    padding: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    z-index: 999;

}

#dock-apps {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* 固定图标样式 */
.system-icon {
    position: relative;
}

.system-icon a {
    text-decoration: none;
    color: white;
}

/* 分隔线样式 */
.dock-separator {
    width: 1px;
    height: 52px;
    background: rgba(255, 255, 255, 0.3);
    margin: 0 10px;
}

/* 固定图标的特殊悬停效果 */
.system-icon:hover {
    transform: scale(1.1);
}

.system-icon img {
    width: 47px;
    height: 47px;
}

.dock-item {
    width: 65px;
    height: 65px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s;
    position: relative;
    border: none; /* 去掉边框 */

}

.dock-item img {
    display: block; /* 使图像成为块级元素，去掉底部空隙 */
    width: 52px; /* 根据需要调整宽度 */
    height: auto; /* 高度自动 */
    border: none; /* 去掉边框 */
    outline: none; /* 去掉轮廓 */
    transition: transform 0.2s; /* 添加平滑过渡效果 */
}

.dock-item:hover img {
    transform: scale(1.1); /* 悬停时放大图标 */
    outline: none; /* 确保悬停时没有轮廓 */
}

.dock-item span {
    font-size: 14px;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    display: none;
    z-index: 100;
}

.dock-item:hover {
    transform: scale(1.2);
    outline: none; /* 确保悬停时没有轮廓 */
    background: transparent; /* 确保背景透明 */
}
.dock-item:focus {
    outline: none; /* 确保获得焦点时没有轮廓 */
}
.dock-item:hover span {
    display: block; /* 显示提示文本 */
    position: absolute; /* 绝对定位 */
    top: -32px; /* 根据需要调整位置 */
    left: 50%; /* 水平居中 */
    transform: translateX(-50%); /* 使其居中 */
    background: rgba(0, 0, 0, 0.7); /* 背景色 */
    color: white; /* 文字颜色 */
    padding: 4px 10px; /* 内边距 */
    border-radius: 4px; /* 圆角 */
    white-space: nowrap; /* 不换行 */
    z-index: 10; /* 提高层级 */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5); /* 添加阴影效果 */
}
.dock-item button {
    background: transparent; /* 背景透明 */
    border: none; /* 无边框 */
    cursor: pointer; /* 鼠标指针样式 */
    padding: 0; /* 去掉内边距 */
}

.dock-item button img {
    display: block; /* 使图像成为块级元素，去掉底部空隙 */
    width: 52px; /* 根据需要调整宽度 */
    height: auto; /* 高度自动 */
}
/* 窗口样式 */
.window {
    position: absolute;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 320px;
    min-height: 240px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.window-header {
    height: 45px;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    padding: 0 8px;
    cursor: move;
    border-bottom: 1px solid rgba(200, 200, 200, 0.3);
}

.window-controls {
    display: flex;
    gap: 8px;
    margin-left: auto;
    padding-right: 8px;
}

.control {
    width: 30px;
    height: 30px;
    border-radius: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    margin: 0 2px;
}

.close {
    order: 3;
    background: #e81123;
    position: relative;
}

.close:hover {
    background: #ff4057;
}

.minimize {
    order: 1;
    background: #dedede;
    position: relative;
}

.minimize:hover {
    background: #f0f0f0;
}

.minimize::after {
    content: '';
    width: 14px;
    height: 3px;
    background: #666;
    position: absolute;
    bottom: 8px;
}

.maximize {
    order: 2;
    background: #dedede;
    position: relative;
}

.maximize:hover {
    background: #f0f0f0;
}

.maximize::before {
    content: '';
    width: 14px;
    height: 14px;
    border: 1px solid #666;
    position: absolute;
}

.window-title {
    font-size: 16px;
    color: #666;
    flex-grow: 1;
    text-align: center;
    margin: 0 12px;
    font-weight: 500;
}

.window-content {
    flex-grow: 1;
    position: relative;
    transition: height 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.window-content iframe {
    width: 100%;
    height: 100%;
    position: absolute;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 窗口状态 */
.window.active {
    box-shadow: 0 8px 40px rgba(0,0,0,0.4);
}

.window.maximized {
    border-radius: 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    transform: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 最大化时的内容区域 */
.window.maximized .window-content {
    height: calc(100% - 45px);
}

/* 动画效果 */
.window {
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.minimized {
    transform: scale(0.1);
    opacity: 0;
}

/* 调整小手柄 */
.ui-resizable-handle {
    position: absolute;
    width: 10px;
    height: 10px;
}

.ui-resizable-se {
    right: -5px;
    bottom: -5px;
    cursor: se-resize;
}

/* 响应式调整 */
@media (max-width: 768px) {
    #desktop-icons {
        grid-template-columns: 70px;
        grid-auto-columns: 70px;
        grid-gap: 15px;
    }

    .desktop-icon {
        width: 70px;
        height: 100px;
    }

    .dock-item {
        width: 40px;
        height: 40px;
    }

    .dock-item img {
        width: 32px;
        height: 32px;
    }
} 

/* 拖动时禁用过渡效果 */
.window.ui-draggable-dragging {
    transition: none;
} 

/* 过渡动画相关类 */
.transitioning {
    pointer-events: none;  /* 过渡期间禁用交互 */
}

/* 优化阴影过渡 */
.window {
    box-shadow: 0 5px 30px rgba(0,0,0,0.3);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.window.maximized {
    box-shadow: none;
} 

/* 添加关闭按钮的X图标 */
.close::before,
.close::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 2px;
    background-color: white;
    top: 50%;
    left: 50%;
}

.close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* 添加滚动条样式 */
#desktop-icons::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

#desktop-icons::-webkit-scrollbar-track {
    background: transparent;
}

#desktop-icons::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

#desktop-icons::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* 桌面时钟框架 */
#clock-frame {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 300px;
    height: 180px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#clock-frame iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* 桌面日期框架 */
#date-frame {
    position: fixed;
    top: 20px;
    right: 345px;
    width: 230px;
    height: 180px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#date-frame iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* 待办事项框架 */
#todo-frame {
    position: fixed;
    top: 220px;
    right: 20px;
    width: 300px;
    height: 310px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.1);
}

#todo-frame iframe {
    width: 100%;
    height: 100%;
    border: none;
    pointer-events: none;  /* 让整个iframe不响应鼠标事件，这样点击时会触发父div的点击事件 */
}

/* 便签条挂件 */
#notes-frame {
    position: fixed;
    top: 550px;  /* 待办事项的top(220px) + height(350px) + gap(20px) */
    right: 20px;
    width: 300px;
    height: 350px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
}

#notes-frame iframe {
    width: 100%;
    height: 100%;
    border: none;
    pointer-events: none;  /* 让整个iframe不响应鼠标事件，这样点击时会触发父div的点击事件 */
}

/* 退出按钮框架 */
#logout-frame {
    position: fixed;
    bottom: 0px;
    left: 90%;
    width: 120px;
    height: 50px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
}

#logout-frame form {
    margin: 0;
    padding: 0;
}

#logout-frame button {
    background: transparent;
    border: none;
    color: white;
    font-size: 14px;
    cursor: pointer;
    padding: 10px 20px;
    transition: all 0.3s ease;
}

#logout-frame:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 登录��罩层 */
#login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
}

.login-box {
    background: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    width: 300px;
}

.login-box h2 {
    color: white;
    text-align: center;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.login-box input {
    width: 100%;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    color: white;
    font-size: 16px;
}

.login-box button {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 5px;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-box button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.error-message {
    color: #ff6b6b;
    text-align: center;
    margin-top: 10px;
    font-size: 14px;
}

/* 桌面弹窗样式 */
.desktop-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 15px;
    padding: 25px;
    width: 90%;
    max-width: 600px;
    color: white;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 500;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    opacity: 0.8;
}

.form-group textarea,
.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-size: 16px;
}

.form-group textarea {
    height: 120px;
    resize: vertical;
}

.form-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 25px;
}

.form-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #2196f3;
    color: white;
}

.btn-primary:hover {
    background: #1976d2;
}

.btn-cancel {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.3);
}