/* macOS Web 模拟环境 - 样式表 */

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

/* 根元素样式 */
html, body {
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* 桌面样式 */
#desktop {
    height: 100vh;
    background: linear-gradient(135deg, #3a7bd5 0%, #00d2ff 100%);
    position: relative;
    overflow: hidden;
    z-index: 10;
}

/* 桌面图标容器样式 */
#desktop-icons {
    z-index: 15;
}

/* 菜单栏样式 */
#menu-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 24px;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 100;
    display: flex;
    align-items: center;
    padding: 0 10px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* 左侧菜单 */
#apple-menu {
    display: flex;
    align-items: center;
    margin-right: 20px;
}

#apple-logo {
    font-size: 16px;
    margin-right: 10px;
}

/* 中间菜单 */
#app-menu {
    display: flex;
    align-items: center;
}

.menu-item {
    padding: 0 10px;
    height: 100%;
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: background-color 0.2s ease;
}

/* 右侧菜单 */
#status-menu {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.status-item {
    padding: 0 8px;
    cursor: pointer;
    font-size: 12px;
}

/* 时间显示 */
#time-display {
    font-size: 12px;
    padding: 0 10px;
}

/* 桌面图标样式 */
.desktop-icon {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 70px;
    cursor: pointer;
    transition: transform 0.1s ease;
    padding: 5px;
    border-radius: 4px;
}

.desktop-icon:hover {
    transform: scale(1.05);
    background-color: rgba(255, 255, 255, 0.2);
}

.desktop-icon.selected {
    background-color: rgba(142, 142, 147, 0.3);
    border-radius: 8px;
    backdrop-filter: blur(5px);
}

.icon-container {
    width: 50px;
    height: 50px;
    background-color: #f0f0f0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s ease;
}

.desktop-icon:hover .icon-container {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.icon-label {
    font-size: 12px;
    text-align: center;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    word-break: break-word;
    width: 100%;
    line-height: 1.3;
}

/* Dock 样式 */
#dock {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    z-index: 99;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-bottom: none;
    transition: background-color 0.3s ease;
}

#dock:hover {
    background: rgba(255, 255, 255, 0.85);
}

.dock-item {
    width: 40px;
    height: 40px;
    margin: 0 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.3);
}

.dock-item:hover {
    background-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.dock-item i {
    font-size: 20px;
    color: #333;
}

/* 窗口容器 */
#windows-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* 窗口阴影 - macOS 风格 */
.window-shadow {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.05);
}

/* 窗口基础样式 */
.fixed {
    position: fixed;
}

.bg-white {
    background-color: #ffffff;
}

.rounded-lg {
    border-radius: 10px;
}

.overflow-hidden {
    overflow: hidden;
}

.transition-all {
    transition: all 0.2s ease;
}

.duration-200 {
    transition-duration: 200ms;
}

.transform {
    transform: translateZ(0);
}

/* macOS 颜色变量 */
.bg-macos-window-bg {
    background-color: #ffffff;
}

.bg-macos-window-titlebar {
    background-color: #f5f5f7;
}

/* 应用特定颜色 */
.bg-macos-finder {
    background-color: #0066ff;
}

.bg-macos-terminal {
    background-color: #111111;
}

.bg-macos-safari {
    background-color: #007aff;
}

.bg-macos-notes {
    background-color: #ffcc00;
}

.bg-macos-mail {
    background-color: #ff3b30;
}

/* 窗口头部样式 */
.window-header {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* 窗口头部拖动区域 */
.window-header:not(:active) {
    cursor: grab;
}

.window-header:active:not(:has(.window-close:active, .window-minimize:active, .window-maximize:active)) {
    cursor: grabbing;
}

.flex {
    display: flex;
}

.h-6 {
    height: 24px;
}

.items-center {
    align-items: center;
}

.px-4 {
    padding-left: 16px;
    padding-right: 16px;
}

.border-b {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.border-gray-200 {
    border-color: #e5e5e7;
}

.space-x-2 > :not(:last-child) {
    margin-right: 8px;
}

.w-3 {
    width: 12px;
}

.h-3 {
    height: 12px;
}

.rounded-full {
    border-radius: 50%;
}

.bg-red-400 {
    background-color: #ff3b30;
}

.bg-yellow-400 {
    background-color: #ffcc00;
}

.bg-green-400 {
    background-color: #34c759;
}

.ml-4 {
    margin-left: 16px;
}

.text-sm {
    font-size: 13px;
}

.font-medium {
    font-weight: 500;
}

.flex-grow {
    flex-grow: 1;
}

.text-center {
    text-align: center;
}

/* 窗口控制按钮交互 */
.window-close, .window-minimize, .window-maximize {
    cursor: pointer;
    transition: transform 0.1s ease, filter 0.2s ease;
    position: relative;
    z-index: 100;
}

.window-close:hover {
    background-color: #ff453a;
    transform: scale(1.1);
}

.window-minimize:hover {
    background-color: #ffd60a;
    transform: scale(1.1);
}

.window-maximize:hover {
    background-color: #30d158;
    transform: scale(1.1);
}

/* 窗口内容样式 */
.window-content {
    overflow: auto;
}

.p-4 {
    padding: 16px;
}

.h\[calc\(100\%-1\.5rem\)\] {
    height: calc(100% - 1.5rem);
}

/* 窗口激活状态 */
.window.active .window-header {
    background-color: #f5f5f7;
}

.window.maximized {
    border-radius: 0;
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes runningPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.7);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(52, 199, 89, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(52, 199, 89, 0);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        transform: translate3d(0, -10px, 0);
    }
    70% {
        transform: translate3d(0, -5px, 0);
    }
    90% {
        transform: translate3d(0, -2px, 0);
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* 右键菜单样式 */
.context-menu {
    position: fixed;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 200;
    padding: 4px 0;
    min-width: 180px;
}

.context-menu-item {
    padding: 6px 16px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.2s ease;
}

.context-menu-item:hover {
    background-color: rgba(0, 0, 0, 0.08);
}

.context-menu-divider {
    height: 1px;
    background-color: rgba(0, 0, 0, 0.1);
    margin: 4px 0;
}

/* 通知中心样式 */
.notification {
    position: fixed;
    top: 30px;
    right: 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.05);
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    max-width: 320px;
    z-index: 150;
    animation: slideInRight 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.notification:hover {
    transform: translateX(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
}

/* 窗口动画增强 */
.window {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease, box-shadow 0.3s ease;
}

.window.active {
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
    z-index: 90;
}

/* Dock 项目增强 */
.dock-item.running::after {
    content: '';
    position: absolute;
    bottom: -2px;
    width: 6px;
    height: 6px;
    background-color: #34c759;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.8);
    animation: runningPulse 2s infinite;
}

/* 桌面图标增强 */
.desktop-icon {
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.desktop-icon.dragging {
    opacity: 0.7;
    transform: scale(1.1) rotate(5deg);
}

/* 右键菜单增强 */
.context-menu {
    animation: fadeIn 0.2s ease;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.context-menu-item {
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.context-menu-item:hover {
    background-color: rgba(0, 122, 255, 0.1);
    color: #007aff;
    padding-left: 18px;
    padding-right: 14px;
}

/* 加载动画 */
.loading {
    animation: spin 1s linear infinite;
}

/* 菜单增强 */
.menu-item {
    transition: all 0.15s ease;
    position: relative;
}

.menu-item:hover {
    background-color: rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

.menu-item.has-submenu::after {
    content: '▾';
    font-size: 8px;
    margin-left: 4px;
    opacity: 0.6;
}

/* 滚动条增强 */
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    transition: background 0.2s ease;
}

/* 文本选择样式 */
::selection {
    background-color: rgba(0, 122, 255, 0.3);
    color: inherit;
}

::-moz-selection {
    background-color: rgba(0, 122, 255, 0.3);
    color: inherit;
}