.nyouos-window {
    position: absolute;
    background: rgba(249, 249, 249, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25), 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.18);
    transition: box-shadow 0.2s ease;
    will-change: left, top, width, height;
}

.nyouos-window.active {
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.35), 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: rgba(0, 120, 212, 0.5);
}

.nyouos-window-titlebar {
    height: 40px;
    background: linear-gradient(180deg, #f8f8f8 0%, #eeeeee 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    -webkit-app-region: drag;
    cursor: default;
    user-select: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.nyouos-window-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #333;
    font-weight: 500;
}

.nyouos-window-icon {
    font-size: 16px;
    line-height: 1;
}

.nyouos-window-title-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nyouos-window-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    -webkit-app-region: no-drag;
}

.nyouos-window-btn {
    width: 32px;
    height: 28px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
    position: relative;
}

.nyouos-window-btn:hover {
    background: rgba(0, 0, 0, 0.08);
}

.nyouos-window-btn:active {
    background: rgba(0, 0, 0, 0.12);
}

.nyouos-window-minimize::after {
    content: '';
    width: 10px;
    height: 2px;
    background: #555;
    border-radius: 1px;
}

.nyouos-window-maximize::after {
    content: '';
    width: 10px;
    height: 10px;
    border: 2px solid #555;
    border-radius: 1px;
}

.nyouos-window-close::after {
    content: '';
    width: 10px;
    height: 10px;
    position: relative;
}

.nyouos-window-close::before,
.nyouos-window-close::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 2px;
    background: #555;
    top: 50%;
    left: 50%;
    margin-left: -5px;
    margin-top: -1px;
    transform: rotate(45deg);
    border-radius: 1px;
}

.nyouos-window-close::after {
    transform: rotate(-45deg);
}

.nyouos-window-close:hover {
    background: #e81123 !important;
}

.nyouos-window-close:hover::before,
.nyouos-window-close:hover::after {
    background: #fff;
}

.nyouos-window-content {
    flex: 1;
    background: #fff;
    overflow: auto;
    position: relative;
}

.nyouos-window-content iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.nyouos-window-resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 15px;
    height: 15px;
    cursor: nwse-resize;
    background: linear-gradient(135deg, transparent 0%, transparent 50%, rgba(0, 120, 212, 0.3) 50%, rgba(0, 120, 212, 0.3) 60%, transparent 60%, transparent 70%, rgba(0, 120, 212, 0.3) 70%, rgba(0, 120, 212, 0.3) 80%, transparent 80%);
    border-radius: 0 0 8px 0;
}

.nyouos-window-minimizing {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
    transition: all 0.2s ease;
}

@media (max-width: 768px) {
    .nyouos-window {
        width: 100vw !important;
        height: calc(100vh - 60px) !important;
        left: 0 !important;
        top: 0 !important;
        border-radius: 0;
    }
    .nyouos-window-resize-handle {
        display: none;
    }
}

.nyouos-window.dark {
    background: rgba(32, 32, 32, 0.98);
    border-color: rgba(255, 255, 255, 0.1);
}

.nyouos-window.dark .nyouos-window-titlebar {
    background: linear-gradient(180deg, #3b3b3b 0%, #2d2d2d 100%);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.nyouos-window.dark .nyouos-window-title {
    color: #eee;
}

.nyouos-window.dark .nyouos-window-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nyouos-window.dark .nyouos-window-minimize::after {
    background: #ccc;
}

.nyouos-window.dark .nyouos-window-maximize::after {
    border-color: #ccc;
}

.nyouos-window.dark .nyouos-window-close::before,
.nyouos-window.dark .nyouos-window-close::after {
    background: #ccc;
}

.nyouos-window.dark .nyouos-window-content {
    background: #1e1e1e;
}
