/* macOS 主界面样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', sans-serif;
    overflow: hidden;
    background: #000;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

.desktop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    opacity: 0;
    transition: opacity 1s ease-in;
}

.desktop.visible {
    opacity: 1;
}

.desktop.hidden {
    opacity: 0;
}

/* 桌面背景 */
.desktop-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../assets/images/background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}


/* 菜单栏 */
.menu-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 28px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    z-index: 1000;
}

.menu-left,
.menu-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.apple-menu {
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.apple-menu:hover {
    transform: scale(1.1);
}

.menu-item {
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.menu-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

#current-time {
    font-weight: 500;
    min-width: 50px;
    text-align: center;
}

/* 窗口容器 */
.windows-container {
    position: absolute;
    top: 28px;
    left: 0;
    width: 100%;
    height: calc(100% - 28px);
    pointer-events: none;
}

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

/* 通用窗口样式 */
.window {
    position: absolute;
    min-width: 400px;
    min-height: 300px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 12px;
    box-shadow:
        0 32px 64px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 100;
}

.window.maximized {
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 0;
    transform: scale(1);
}

.window.maximizing {
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.window.restoring {
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}


.window.active {
    z-index: 200;
}

/* 窗口标题栏 */
.window-header {
    height: 52px;
    background: rgba(246, 246, 246, 0.9);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    padding: 0 20px;
    cursor: move;
}

.window-controls {
    display: flex;
    gap: 8px;
    margin-right: 16px;
}

.control-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: opacity 0.2s ease;
    position: relative;
}

.control-btn:hover {
    opacity: 0.8;
}

.control-btn.close {
    background: #ff5f57;
}

.control-btn.minimize {
    background: #ffbd2e;
}

.control-btn.maximize {
    background: #28ca42;
}

.control-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.control-btn:hover::before {
    opacity: 1;
}

.control-btn.close::before {
    content: '×';
    color: #4d0000;
    font-size: 10px;
    font-weight: bold;
}

.control-btn.minimize::before {
    content: '−';
    color: #4d2600;
    font-size: 10px;
    font-weight: bold;
}

.control-btn.maximize::before {
    content: '+';
    color: #0d4000;
    font-size: 10px;
    font-weight: bold;
}

.window-title {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

/* 窗口内容 */
.window-content {
    height: calc(100% - 52px);
    overflow-y: auto;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .menu-bar {
        padding: 0 12px;
    }

    .menu-left,
    .menu-right {
        gap: 15px;
    }

    .menu-item {
        font-size: 12px;
        padding: 3px 6px;
    }

    .window {
        min-width: 320px;
        min-height: 250px;
    }

    .window-content {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .menu-bar {
        height: 24px;
        padding: 0 8px;
    }

    .windows-container {
        top: 24px;
        height: calc(100% - 24px);
    }

    .menu-item {
        font-size: 11px;
    }

    .window {
        min-width: 280px;
        min-height: 200px;
    }

    .window-header {
        height: 44px;
        padding: 0 15px;
    }

    .window-content {
        height: calc(100% - 44px);
        padding: 12px;
    }
}

/* 全局安全保护样式 */
* {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* 防止拖拽 */
img, a, div {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
}

/* 禁用文本选择高亮 */
::selection {
    background: transparent;
}

::-moz-selection {
    background: transparent;
}

/* 移除触摸高亮 */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

/* 防止长按菜单 */
a, img {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* 系统崩溃屏幕样式 */
.crash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.crash-screen.active {
    opacity: 1;
    visibility: visible;
}

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

.crash-container {
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.crash-icon {
    font-size: 200px;
    animation: crashPulse 2s ease-in-out infinite;
    filter: drop-shadow(0 0 50px rgba(255, 255, 255, 0.8));
}

@keyframes crashPulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 50px rgba(255, 255, 255, 0.8));
    }
    50% {
        transform: scale(1.1);
        filter: drop-shadow(0 0 80px rgba(255, 255, 255, 1));
    }
}

/* 崩溃屏幕动画 */
.crash-screen.entering {
    animation: crashEnter 1s ease-out;
}

@keyframes crashEnter {
    0% {
        opacity: 0;
        transform: scale(1.1);
    }
    50% {
        opacity: 0.8;
        transform: scale(0.98);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* 响应式崩溃屏幕 */
@media (max-width: 768px) {
    .crash-icon {
        font-size: 150px;
    }
}

@media (max-width: 480px) {
    .crash-icon {
        font-size: 120px;
    }
}

/* SVG图标样式 */
.svg-icon-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.svg-icon-container svg {
    display: block;
    transition: all 0.3s ease;
}

/* 启动屏幕图标 */
.lock-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
    margin: 0 auto;
}

/* 崩溃屏幕图标 */
.crash-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 200px;
    height: 200px;
}

/* 菜单栏图标 */
.apple-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.battery-icon,
.wifi-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

/* 关于本机大图标 */
.lock-large-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
}

/* Dock图标容器 */
.icon-content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* 图标悬停效果 */
.dock-item:hover .svg-icon-container svg {
    transform: scale(1.1);
}

/* 应用启动动画 */
@keyframes iconBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.dock-item.launching .svg-icon-container svg {
    animation: iconBounce 0.6s ease-out;
}